Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- location /backend {
- #CORS
- if ($request_method = 'OPTIONS') {
- add_header 'Access-Control-Allow-Origin' '*' always;
- add_header 'Access-Control-Allow-Credentials' 'true' always;
- add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
- 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;
- add_header 'Access-Control-Max-Age' 1728000;
- add_header 'Content-Type' 'text/plain charset=UTF-8';
- add_header 'Content-Length' 0;
- return 200;
- }
- proxy_set_header X-Real-IP $remote_addr;
- add_header 'Access-Control-Allow-Origin' '*' always;
- proxy_pass $backend;
- }
Advertisement
Add Comment
Please, Sign In to add comment