Failed to load resource: the server responded with a status of 405 (Not Allowed)
今天在部署vue项目时遇到这样的问题:Failed to load resource: the server responded with a status of 405 (Not Allowed)这个问题是nginx服务器默认post不能访问静态资源。解决方法如下:server {listen监听端口;server_name 域名;#charset koi8-r;#access_loglogs/
·
今天在部署vue项目时遇到这样的问题:
Failed to load resource: the server responded with a status of 405 (Not Allowed)
这个问题是nginx服务器默认post不能访问静态资源。
解决方法如下:
server {
listen 监听端口;
server_name 域名;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
#加上这行代码
error_page 405 =200 http://$host$request_uri;
}
更多推荐
已为社区贡献1条内容
所有评论(0)