lnmp一键安装后 为什么反向代理总是报错呀?
报错代码:400 Bad RequestRequest Header Or Cookie Too Large
我在百度找了找,修改了下也不行,lnmp刚刚装完之后,设置反向代理可以访问,过一会就不行了,昨天也是这样
反向代理设置:
server
{
listen 80;
listen [::]:80;
server_name 1a.xztd.cyou ;
index index.html index.htm index.php default.html default.htm default.php;
root/home/wwwroot/1a.xztd.cyou;
location / {
proxy_pass http://3a.xztd.cyou;
proxy_http_version 1.1;
proxy_cache_bypass $http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto$scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
access_log/home/wwwlogs/1a.xztd.cyou.log;
}
报错代码:
400 Bad RequestRequest Header Or Cookie Too Largenginx 我研究了下,百多说的修改 client_header_buffer_size 和 large_client_header_buffers 两个值并没有用,我测试了半天,发现把这段反代代码删除就正常了proxy_set_header Host $host; 为什么会这样呀?是因为是二级域名的原因吗? 我弄好了把 $host 修改为源域名就正常了。不知道为什么会这样。。。
页:
[1]