反向代理

反向代理

2 回复

nginx反向代理webman出现502错误 upstream prematurely closed

分享supereric 发表了文章 • 2 个评论 • 406 次浏览 • 2021-05-22 13:47 • 来自相关话题

nginx反向代理webman出现502错误 nginx 错误 2021/05/21 23:21:46 [error] 75037#0: *234 upstream prematurely closed connecti ...查看全部

nginx反向代理webman出现502错误


nginx 错误



2021/05/21 23:21:46 [error] 75037#0: *234 upstream prematurely closed connection while reading response header from upstream, client: 172.16.253.1, server: webman.cc, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/";, host: "webman.cc"



nginx location配置为


location /
{
proxy_pass http://127.0.0.1:8080;
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 REMOTE-HOST $remote_addr;
add_header X-Cache $upstream_cache_status;
#Set Nginx Cache
add_header Cache-Control no-cache;
expires 12h;
}

将配置项


proxy_set_header Connection "Upgrade";

修改为


proxy_set_header Connection "Keep-Alive";

后问题解决。ws连接正常
和文档中不太一样有人可以解释一下问题吗

1 回复

HTTP代理需要用户名与密码

提问阿山 回复了问题 • 3 人关注 • 2018-10-24 13:06 • 来自相关话题

1 回复

Websocket: Workerman + Nginx反代 下如何获取用户的IP

提问walkor 回复了问题 • 2 人关注 • 2016-09-05 14:11 • 来自相关话题

1 回复

HTTP代理需要用户名与密码

回复

提问阿山 回复了问题 • 3 人关注 • 2018-10-24 13:06 • 来自相关话题

1 回复

Websocket: Workerman + Nginx反代 下如何获取用户的IP

回复

提问walkor 回复了问题 • 2 人关注 • 2016-09-05 14:11 • 来自相关话题

2 回复

nginx反向代理webman出现502错误 upstream prematurely closed

分享supereric 发表了文章 • 2 个评论 • 406 次浏览 • 2021-05-22 13:47 • 来自相关话题

nginx反向代理webman出现502错误 nginx 错误 2021/05/21 23:21:46 [error] 75037#0: *234 upstream prematurely closed connecti ...查看全部

nginx反向代理webman出现502错误


nginx 错误



2021/05/21 23:21:46 [error] 75037#0: *234 upstream prematurely closed connection while reading response header from upstream, client: 172.16.253.1, server: webman.cc, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/";, host: "webman.cc"



nginx location配置为


location /
{
proxy_pass http://127.0.0.1:8080;
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 REMOTE-HOST $remote_addr;
add_header X-Cache $upstream_cache_status;
#Set Nginx Cache
add_header Cache-Control no-cache;
expires 12h;
}

将配置项


proxy_set_header Connection "Upgrade";

修改为


proxy_set_header Connection "Keep-Alive";

后问题解决。ws连接正常
和文档中不太一样有人可以解释一下问题吗