vue nginx 部署后请求405 解决办法

vue

这种问题大概率是你的nginx  location 设置问题:

server {
listen 443 ssl;
ssl_certificate /etc/nginx/cert/server.crt;
ssl_certificate_key /etc/nginx/cert/server.key;
server_name beta.sc.cn;
charset utf-8;
client_max_body_size 50M;

location /demo-service/api {
include uwsgi_params;
uwsgi_param HTTP_X_FORWARDED_PROTOCOL https;
uwsgi_pass rookie:8000;
}
location / {
root /code/dist;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
}

vue  接口前缀开头要和nginx   location  /demo-service/api 后端设置保持一致

 

以上是 vue nginx 部署后请求405 解决办法 的全部内容, 来源链接: utcz.com/z/377901.html

回到顶部