nginx.htaccess 541 B

123456789101112131415
  1. location / {
  2. add_header 'Access-Control-Allow-Origin' '*';
  3. add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
  4. add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization';
  5. add_header 'Access-Control-Allow-Credentials' 'true';
  6. add_header 'Access-Control-Max-Age' 3600;
  7. if ($request_method = 'OPTIONS') {
  8. # OPTIONS 请求直接返回 200
  9. return 204;
  10. }
  11. try_files $uri $uri/ /index.php?$query_string;
  12. }