Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- events {
- worker_connections 1024;
- }
- http {
- include /etc/nginx/mime.types;
- default_type application/octet-stream;
- server {
- listen 8000;
- location / {
- if ($request_method = 'OPTIONS') {
- add_header 'Access-Control-Allow-Credentials' true;
- add_header 'Access-Control-Allow-Origin' $http_origin;
- add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
- add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
- add_header 'Access-Control-Max-Age' 1728000;
- add_header 'Content-Type' 'text/plain; charset=utf-8';
- add_header 'Content-Length' 0;
- return 204;
- }
- proxy_pass http://127.0.0.1:3000;
- proxy_set_header X-Forwarded-For $remote_addr;
- }
- location /api {
- if ($request_method = 'OPTIONS') {
- add_header 'Access-Control-Allow-Credentials' true;
- add_header 'Access-Control-Allow-Origin' $http_origin;
- add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS, PUT, PATCH';
- add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Cookie';
- add_header 'Access-Control-Expose-Headers' 'Content-Length,Set-Cookie,Content-Range';
- add_header 'Access-Control-Max-Age' 1728000;
- add_header 'Content-Type' 'text/plain; charset=utf-8';
- add_header 'Content-Length' 0;
- return 204;
- }
- proxy_pass http://127.0.0.1:5463;
- proxy_set_header X-Forwarded-For $remote_addr;
- }
- location ~ /api/(v[0-9]+)/ {
- if ($request_method = 'OPTIONS') {
- add_header 'Access-Control-Allow-Credentials' true;
- add_header 'Access-Control-Allow-Origin' $http_origin;
- add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS, PUT';
- add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Cookie';
- add_header 'Access-Control-Expose-Headers' 'Content-Length,Set-Cookie,Content-Range';
- add_header 'Access-Control-Max-Age' 1728000;
- add_header 'Content-Type' 'text/plain; charset=utf-8';
- add_header 'Content-Length' 0;
- return 204;
- }
- proxy_pass http://127.0.0.1:8088;
- proxy_set_header X-Forwarded-For $remote_addr;
- }
- location ~ /api/file/ {
- client_max_body_size 0;
- if ($request_method = 'GET') {
- add_header 'Content-Type' 'data:application/octet-stream';
- }
- proxy_pass http://127.0.0.1:8088;
- proxy_set_header X-Forwarded-For $remote_addr;
- }
- location /files/ {
- root /usr/share/nginx/app/static;
- gzip on;
- }
- add_header 'Access-Control-Allow-Origin' $http_origin always;
- add_header 'Access-Control-Allow-Credentials' true always;
- add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, OPTIONS' always;
- add_header 'Access-Control-Allow-Headers' 'DNT,Cookie,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
- add_header 'Access-Control-Expose-Headers' 'Content-Length,Set-Cookie,Content-Range' always;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement