Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. add_header 'Access-Control-Allow-Origin' $http_origin;
  2. add_header 'Access-Control-Allow-Credentials' 'true';
  3. add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
  4. add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With';
  5. # required to be able to read Authorization header in frontend
  6. # add_header 'Access-Control-Expose-Headers' 'Authorization';
  7.  
  8. if ($request_method = 'OPTIONS') {
  9. # Tell client that this pre-flight info is valid for 20 days
  10. add_header 'Access-Control-Max-Age' 1728000;
  11. add_header 'Content-Type' 'text/plain charset=UTF-8';
  12. add_header 'Content-Length' 0;
  13. return 204;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement