Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[改进意见] 当前宝塔的反向代理功能开启后,会影响SSL自动续签 #97

Open
xiaohuilam opened this issue Mar 29, 2022 · 1 comment

Comments

@xiaohuilam
Copy link

BaoTa/class/panelSite.py

Lines 2696 to 2719 in f776b5d

#PROXY-START%s
location ~* \.(php|jsp|cgi|asp|aspx)$
{
proxy_pass %s;
proxy_set_header Host %s;
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;
}
location %s
{
proxy_pass %s;
proxy_set_header Host %s;
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
%s
%s
expires 12h;
}

你们可以判读啊用户创建的反代目录规则,如果用户想反代 / (http根路径) 时候,可以将规则替换为

#PROXY-START/

location ~ ^/(?!(.well-known))
{
    proxy_pass https://www.baidu.com;
    proxy_set_header Host www.baidu.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;
}

.well-known 排除在反代之外,这样,SSL续签就不受影响了。

@kooy
Copy link

kooy commented Sep 12, 2022

宝塔 github 长时间不维护,从来不回复问题,你们知道什么原因吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants