NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
jsjcjsjc
V2EX  ›  NGINX

为啥这个网站使用宝塔只能反代首页?点其他的就回复到原站

  •  1
     
  •   jsjcjsjc · Sep 25, 2022 · 3414 views
    This topic created in 1340 days ago, the information mentioned may be changed or developed.

    我的配置是这样的,但是只能反代首页,点击其他链接就会恢复网址哈~

    同时测试了几个其他网址,没问题哈

    感谢

    11 replies    2022-09-26 19:45:20 +08:00
    jsjcjsjc
        1
    jsjcjsjc  
    OP
       Sep 25, 2022
    就这个网址 www.websiteplanet.com
    zggsong
        2
    zggsong  
       Sep 25, 2022
    去研究一下这个 https://reflare.js.org/
    o00o
        3
    o00o  
       Sep 25, 2022
    求盗于路?
    xilou31
        4
    xilou31  
       Sep 25, 2022
    没用过宝塔,但是你这个像是只反代了 url ,没有反代网址后的 uri
    placeholder
        5
    placeholder  
       Sep 25, 2022
    不是,网页里用 a 标签写死的 href 也能反代吗?
    chengran630
        6
    chengran630  
       Sep 25, 2022
    点那个高级功能,“代理目录”填 /
    jsjcjsjc
        7
    jsjcjsjc  
    OP
       Sep 25, 2022
    @lcy630409 感谢恢复
    好像也不行哈~~
    treblex
        8
    treblex  
       Sep 25, 2022
    因为他 a 标签都是写的完整路径,包含了域名的
    用 php curl 之后替换部分内容输出似乎是可以的
    jsjcjsjc
        9
    jsjcjsjc  
    OP
       Sep 25, 2022
    @treblex nginx 无解吗?
    Ch3n4y
        10
    Ch3n4y  
       Sep 25, 2022
    发送域名改为$host 试试
    jsjcjsjc
        11
    jsjcjsjc  
    OP
       Sep 26, 2022
    搞定
    ```
    location / {
    proxy_ssl_name www.websiteplanet.com;
    proxy_ssl_server_name on;
    gzip on;
    gzip_min_length 1k;
    gzip_buffers 4 16k;
    gzip_comp_level 5;
    gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
    gzip_vary off;
    proxy_redirect off;
    proxy_set_header Host www.websiteplanet.com;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass https://www.websiteplanet.com;
    proxy_set_header Accept-Encoding "";
    sub_filter 'websiteplanet.com' 'websiteplanet.org';
    sub_filter_types text/xml;
    sub_filter_once off;
    }
    ```
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4151 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 10:11 · PVG 18:11 · LAX 03:11 · JFK 06:11
    ♥ Do have faith in what you're doing.