update
This commit is contained in:
parent
23bda4a56f
commit
fbf2b43865
16
nginx-extra.conf
Normal file
16
nginx-extra.conf
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
server {
|
||||||
|
## ...
|
||||||
|
location ~ [^/]\.php(/|$) {
|
||||||
|
# 添加CORS头部
|
||||||
|
add_header 'Access-Control-Allow-Origin' '*' always;
|
||||||
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
|
||||||
|
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type' always;
|
||||||
|
add_header 'Access-Control-Max-Age' 1728000 always;
|
||||||
|
# 处理预检请求
|
||||||
|
if ($request_method = 'OPTIONS' ) {
|
||||||
|
return 204;
|
||||||
|
}
|
||||||
|
## ...
|
||||||
|
}
|
||||||
|
## ...
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user