我对Nginx非常陌生,我目前正在尝试在Nginx上代理weebly (https://ldmryeah.weebly.com/),它充当了一个反向代理。然而,经过几次尝试,我所得到的只是默认的Weebly的404页。
下面是我尝试过的一些配置:
# most basic one
location /weebly {
proxy_pass $WEEBLY_ENDPOINT;
}也试过那个
# tried to emulate how a browser would access to the weebly website
location /weebly {
proxy_pass $WEEBLY_ENDPOINT;
proxy_redirect off;
add_header Host ldmryeah.weebly.com;
proxy_set_header Accept-Encoding "gzip, deflate, br";
proxy_set_header Accept "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9";
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_pass的后缘和位置,而不会对结果产生影响。
有谁有主意吗?谢谢
发布于 2020-01-27 13:37:35
经过几次试验,我通过使用这个配置成功地使它工作起来。
####
# Weebly
####
location /blog/ {
proxy_pass https://.weebly.com/;
proxy_set_header Host .weebly.com;
}
###
# assets
###
location ~ ^/(gdpr|uploads|files|ajax)/ {
proxy_pass https://.weebly.com;
}请注意,尽管您可以直接在/blog/下键入页面来访问生根系统,但它仍然无法工作。
https://serverfault.com/questions/1000243
复制相似问题