错误贴图
nginx日志报400 bad request错误
修改nginx配置文件
添加一下三行
server {
listen 80;
server_name localhost;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-Ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
location / {
#proxy_set_header Host $host:$server_port;
#proxy_set_header X-Real-Ip $remote_addr;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8000;
proxy_http_version 1.1; #添加
proxy_set_header Upgrade $http_upgrade; #添加
proxy_set_header Connection "upgrade"; #添加
}
}
原文地址:http://blog.51cto.com/haoyonghui/2091322
时间: 2024-11-10 05:46:08