vue-hisory项目在nginx下的伪静态配置
location / {
try_files $uri $uri/ /index.html last;
index index.html;
}
add_header 'Access-Control-Allow-Origin' '*' always; #允许来自所有的访问地址
add_header 'Access-Control-Allow-Credentials' 'true' always; #允许来自所有的访问地址
add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, token, platform' always;
add_header 'Access-Control-Allow-Methods' 'GET,POST,PUT,DELETE,HEAD,OPTIONS' always; #允许来自所有的访问地址
if ($request_method = OPTIONS ) {
return 200;
}
License:
CC BY 4.0