Advertisement
Guest User

CORS settings

a guest
Jun 26th, 2020
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. location ~ ^/app1(\/)(.*)$ {
  2.  
  3. if ($request_method = 'OPTIONS') {
  4. add_header 'Access-Control-Allow-Origin' 'http://localhost/app1/';
  5. add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
  6. add_header 'Access-Control-Max-Age' 1728000;
  7. add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
  8. add_header 'Content-Type' 'text/plain; charset=utf-8';
  9. add_header 'Content-Length' 0;
  10. return 204;
  11. }a
  12.  
  13. if ($request_method = (GET|POST|OPTIONS|HEAD)) {
  14. add_header 'Access-Control-Allow-Origin' 'http://localhost/app1/';
  15. add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
  16. add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
  17. add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
  18. add_header 'Access-Control-Allow-Credentials' 'true'
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement