-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Description
联系方式
No response
1Panel 版本
v1.9.6
问题描述
如图,当openresty发生错误时无法编辑配置文件
重现步骤
创建一个正常的站点,使用www.<your domain>,确保访问www.<your domain>是正常的,此时访问www.<your domain>/img/xxx.png应返回404
创建一个新的站点,使用img.<your domain>,确保img.<your domain>/img/xxx.png访问时正常
以上两个站点配置好https
在www.<your domain>中创建一个反向代理,名称随意,匹配规则默认,前端路径使用/img,代理路径使用https://img.<your domain>/img
此时访问www.<your domain>/img/xxx.png应显示为某图片
直接删除img.<your domain>的DNS解析记录,稍等片刻DNS全球同步后重启即可复现此问题
期待的正确结果
当openresty发生错误时依然可以编辑配置文件,此时应该增加一个直接强制保存配置文件的功能而不是必须nginx -t通过后才予以保存,因为此时使用此命令会提示无法连接至容器,同时也拒绝保存配置文件
相关日志输出
1Panel-openresty-xaCl | 2024/02/22 11:26:01 [emerg] 1#1: host not found in upstream "img.<your domain>" in /www/sites/www.<your domain>/proxy/img.conf:2
1Panel-openresty-xaCl | nginx: [emerg] host not found in upstream "img.<your domain>" in /www/sites/www.<your domain>/proxy/img.conf:2附加信息
No response
