We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
` location / { autoindex on; # 启用目录索引 try_files $uri $uri/ =404;
# 无条件添加 CORS 头部,允许所有请求 add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' '*'; add_header 'Access-Control-Allow-Headers' '*'; add_header 'Access-Control-Max-Age' 1728000; # 预检请求的特殊处理 if ($request_method = 'OPTIONS') { add_header 'Content-Type' 'text/plain; charset=utf-8'; add_header 'Content-Length' 0; return 204; } }
`
The text was updated successfully, but these errors were encountered:
location ~* \.(gif|jpg|jpeg|png|bmp|swf)$ { add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Headers X-Requested-With; add_header Access-Control-Allow-Methods GET,POST,OPTIONS; }
Sorry, something went wrong.
No branches or pull requests
`
location / {
autoindex on; # 启用目录索引
try_files $uri $uri/ =404;
`
The text was updated successfully, but these errors were encountered: