×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Bash
Posted by: Сергей Шевченко
Added: Feb 3, 2020 11:52 AM
Modified: Feb 3, 2020 11:52 AM
Views: 4282
  1. if ($request_method = 'OPTIONS') {
  2.     add_header 'Access-Control-Allow-Origin' '*' always;
  3.     add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
  4.     add_header 'Access-Control-Allow-Credentials' 'true' always;
  5.     add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always;
  6.     add_header 'Access-Control-Max-Age' 86400;
  7.     add_header 'Content-Type' 'text/plain; charset=utf-8';
  8.     add_header 'Content-Length' 0;
  9.  
  10.     return 204;
  11. }
  12.