Guest User

Untitled

a guest
May 25th, 2021
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 0.91 KB | None | 0 0
  1.  location /backend {
  2.             #CORS
  3.             if ($request_method = 'OPTIONS') {
  4.                 add_header 'Access-Control-Allow-Origin' '*' always;
  5.                 add_header 'Access-Control-Allow-Credentials' 'true' always;
  6.                 add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
  7.                 add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With,app-version, AppVersion, DeviceId, CaptchaToken' always;
  8.                 add_header 'Access-Control-Max-Age' 1728000;
  9.                 add_header 'Content-Type' 'text/plain charset=UTF-8';
  10.                 add_header 'Content-Length' 0;
  11.                 return 200;
  12.             }
  13.     proxy_set_header X-Real-IP $remote_addr;
  14.     add_header 'Access-Control-Allow-Origin' '*' always;
  15.         proxy_pass $backend;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment