Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.25 KB | None | 0 0
  1. if ($request_method = 'OPTIONS') {
  2.             add_header 'Access-Control-Allow-Origin' '*';
  3.             add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
  4.             add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,csrftoken,csrfToken,Authorization';
  5.             add_header 'Access-Control-Max-Age' 1728000;
  6.             add_header 'Content-Type' 'text/plain charset=UTF-8';
  7.             add_header 'Content-Length' 0;
  8.             return 204;
  9.          }
  10.  
  11.          if ($request_method = 'POST') {
  12.             add_header 'Access-Control-Allow-Origin' '*';
  13.             add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
  14.             add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
  15.          }
  16.  
  17.          if ($request_method = 'GET') {
  18.             add_header 'Access-Control-Allow-Origin' '*';
  19.             add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
  20.             add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
  21.          }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement