1Panel
1Panel copied to clipboard
[BUG]反代后出现站点停止运行
联系方式
No response
1Panel 版本
1.2.0
问题描述
创建子域名反代到主域名的子目录去,打开子域名显示如下:
重现步骤
项目是flarum,tag1.a.com反代到a.com/t/tag1
期待的正确结果
No response
相关日志输出
No response
附加信息
No response
网站状态正常吗
网站状态正常吗
正常 日志里没有报错
网站状态正常吗
正常 日志里没有报错
贴一下网站的 openresty 配置文件
网站状态正常吗
正常 日志里没有报错
贴一下网站的 openresty 配置文件
server { listen 80 ; listen [::]:80 ; server_name tag1.a.com; index index.php index.html index.htm default.php default.htm default.html; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $server_name; proxy_set_header X-Real-IP $remote_addr; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; access_log /www/sites/flarum-tag/log/access.log; error_log /www/sites/flarum-tag/log/error.log; access_by_lua_file /www/common/waf/access.lua; set $RulePath /www/sites/flarum-tag/waf/rules; set $logdir /www/sites/flarum-tag/log; set $redirect on; set $attackLog on; set $CCDeny off; set $urlWhiteAllow off; set $urlBlockDeny off; set $argsDeny off; set $postDeny off; set $cookieDeny off; set $fileExtDeny off; set $ipBlockDeny off; set $ipWhiteAllow off; location ~ /.well-known/acme-challenge { allow all; root /usr/share/nginx/html; } include /www/sites/flarum-tag/proxy/*.conf; }
这是proxy文件夹下的生成的配置
location ^~ / { proxy_pass http://127.0.0.1:2003/t/tag1; proxy_set_header Host a.com; 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; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_http_version 1.1; add_header Cache-Control no-cache; } 以上代码只因为隐私改了下域名
今天更新1.2.2后重新创建了一遍 发现又成502报错了
更新前和更新后的区别就是1.2.2版本前proxy_pass 直接是域名 http://a.com/t/tag1 更新后是 http:127.0.0.1:2003/t/tag1 更新前子域名是是停止运行那个报错,更新后502报错
错误日志: 2023/05/11 10:21:37 [error] 1166#1166: *72098 upstream prematurely closed connection while reading response header from upstream, client: 58.62.201.34, server: tag1.a.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:2003/t/tag1", host: "tag1.a.com" 2023/05/11 10:21:38 [error] 1166#1166: *72098 upstream prematurely closed connection while reading response header from upstream, client: 58.62.201.34, server: tag1.a.com, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:2003/t/tag1favicon.ico", host: "tag1.a.com", referrer: "http://tag1.a.com/" 1.2.2版本前的停止运行无错误日志生成
网站状态正常吗
正常 日志里没有报错
贴一下网站的 openresty 配置文件
server { listen 80 ; listen [::]:80 ; server_name tag1.a.com; index index.php index.html index.htm default.php default.htm default.html; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $server_name; proxy_set_header X-Real-IP $remote_addr; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; access_log /www/sites/flarum-tag/log/access.log; error_log /www/sites/flarum-tag/log/error.log; access_by_lua_file /www/common/waf/access.lua; set $RulePath /www/sites/flarum-tag/waf/rules; set $logdir /www/sites/flarum-tag/log; set $redirect on; set $attackLog on; set $CCDeny off; set $urlWhiteAllow off; set $urlBlockDeny off; set $argsDeny off; set $postDeny off; set $cookieDeny off; set $fileExtDeny off; set $ipBlockDeny off; set $ipWhiteAllow off; location ~ /.well-known/acme-challenge { allow all; root /usr/share/nginx/html; } include /www/sites/flarum-tag/proxy/*.conf; }
这是proxy文件夹下的生成的配置
location ^~ / { proxy_pass http://127.0.0.1:2003/t/tag1; proxy_set_header Host a.com; 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; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_http_version 1.1; add_header Cache-Control no-cache; } 以上代码只因为隐私改了下域名
今天更新1.2.2后重新创建了一遍 发现又成502报错了
更新前和更新后的区别就是1.2.2版本前proxy_pass 直接是域名 http://a.com/t/tag1 更新后是 http:127.0.0.1:2003/t/tag1 更新前子域名是是停止运行那个报错,更新后502报错
错误日志: 2023/05/11 10:21:37 [error] 1166#1166: *72098 upstream prematurely closed connection while reading response header from upstream, client: 58.62.201.34, server: tag1.a.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:2003/t/tag1", host: "tag1.a.com" 2023/05/11 10:21:38 [error] 1166#1166: *72098 upstream prematurely closed connection while reading response header from upstream, client: 58.62.201.34, server: tag1.a.com, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:2003/t/tag1favicon.ico", host: "tag1.a.com", referrer: "http://tag1.a.com/" 1.2.2版本前的停止运行无错误日志生成
您好 我们没有复现此问题
