Ankit-Kulkarni

nginx cors

Sep 6th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. location / {
  2.  
  3. set $cors '';
  4. add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since, xsrfcookiename, xsrfheadername,X-Forwarded-For';
  5.  
  6. proxy_pass http://someupstreamserver;
  7. include uwsgi_params;
  8. proxy_set_header X-Forwarded-Proto https;
  9. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  10. proxy_set_header X-Real-IP $remote_addr;
  11. proxy_set_header X-Scheme $scheme;
  12. proxy_read_timeout 800s;
  13. proxy_connect_timeout 800s;
  14. proxy_set_header Connection '';
  15. proxy_http_version 1.1;
  16. chunked_transfer_encoding off;
  17. proxy_buffering off;
  18. proxy_cache off;
  19. proxy_redirect off;
  20. proxy_set_header Host $http_host;
  21. }
  22.  
  23. }
Add Comment
Please, Sign In to add comment