您的位置:首页 > 运维架构 > Nginx

nginx把POST转GET请求解决405问题

2017-12-12 00:07 1501 查看

405重定向,然后把POST转GET

upstream local {
server 10.0.1.11:81;
}

server {
listen 81;
server_name testf.xxx.com;

location / {
root /data/f/ROOT/;
index index.html index.htm;
# 解决vue history模式,刷新404问题。
try_files $uri $uri/ /index.html;
}

error_page 405 =200 @405;
location @405 {
root /data/f/ROOT/;
proxy_method GET;
proxy_pass http://local/$request_uri;
}

location /cashloan/ {
proxy_pass https://testapicashloan.xxx.com;

}

location /front/ {
proxy_pass https://testapifront.xxx.com;
}

access_log  /app/logs/f_access.log  main;
}

server {
listen 80;
server_name testf.xxx.com;
location / {
rewrite ^(.*) https://$server_name$1 permanent;
}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: