Advertisement
Guest User

Untitled

a guest
Nov 21st, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.46 KB | None | 0 0
  1. erver {
  2.         listen 9090 default_server;
  3.         listen [::]:9090 default_server ipv6only=on;
  4.  
  5.         root /usr/share/nginx/html/secucar/public_html;
  6.         index index.html index.htm;
  7.  
  8.         # Make site accessible from http://localhost/
  9.         server_name localhost;
  10.  
  11.         location / {
  12.                 # First attempt to serve request as file, then
  13.                 # as directory, then fall back to displaying a 404.
  14. #               try_files $uri $uri/ =404;
  15.               # For CORS
  16.                 if ($request_method = OPTIONS ) {
  17.                         add_header Access-Control-Allow-Origin "$http_origin"; # <- needs to be updated
  18.                         add_header Access-Control-Allow-Methods "GET, OPTIONS, POST";
  19.                         add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
  20.                         add_header Access-Control-Allow-Credentials "true";        # <- Basic Auth stuff, again
  21.                         add_header Content-Length 0;
  22.                         add_header Content-Type text/plain;
  23.                         add_header 'Access-Control-Max-Age' 1728000;
  24.                         return 204;
  25.                 }
  26.  
  27.                 root /usr/share/nginx/html/secucar/public_html;
  28.                 index index.html;
  29.         }
  30.  
  31.         location /secucar {
  32.                proxy_pass http://127.0.0.1:8080/;
  33.         }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement