Advertisement
Guest User

Untitled

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