首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Nginx代理weebly站点显示Weeble404错误

Nginx代理weebly站点显示Weeble404错误
EN

Server Fault用户
提问于 2020-01-24 11:38:54
回答 1查看 142关注 0票数 1

我对Nginx非常陌生,我目前正在尝试在Nginx上代理weebly (https://ldmryeah.weebly.com/),它充当了一个反向代理。然而,经过几次尝试,我所得到的只是默认的Weebly的404页。

下面是我尝试过的一些配置:

代码语言:javascript
复制
# most basic one
location /weebly {
      proxy_pass $WEEBLY_ENDPOINT; 
}

也试过那个

代码语言:javascript
复制
# 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的后缘和位置,而不会对结果产生影响。

有谁有主意吗?谢谢

EN

回答 1

Server Fault用户

回答已采纳

发布于 2020-01-27 13:37:35

经过几次试验,我通过使用这个配置成功地使它工作起来。

代码语言:javascript
复制
####
# 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/下键入页面来访问生根系统,但它仍然无法工作。

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/1000243

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档