You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Apache反向代理其他站点时自动在链接末尾添加204的问题求助

Apache反向代理其他站点时自动在链接末尾添加204的问题求助

各位大佬好,我遇到了一个Apache反向代理的问题,想请大家帮忙排查一下。我现在有两个站点:a.example.com 和 b.example.com,打算在a.example.com上配置Apache2反向代理,让用户访问a.example.com时,服务器会去请求b.example.com并把内容转发回给用户。

我写了如下的配置文件内容:

<VirtualHost *:80>
    ServerName a.example.com
    ProxyPreserveHost On
    ProxyPass / http://b.example.com/
    ProxyPassReverse / http://b.example.com/
    ErrorLog /var/log/apache2/error.log
    LogLevel debug
</VirtualHost>

<VirtualHost *:443>
    ServerName a.example.com
    ProxyPreserveHost On
    SSLProxyEngine On
    ProxyPass / https://b.example.com/
    ProxyPassReverse / https://b.example.com/
    SSLCertificateFile     /etc/certs/a.example.com/fullchain.pem
    SSLCertificateKeyFile  /etc/certs/a.exmaple.com/privkey.pem
    SSLProxyVerify none
    SSLProxyCheckPeerCN off
    SSLProxyCheckPeerName off
    SSLProxyCheckPeerExpire off
    ErrorLog /var/log/apache2/ssl_engine.log
    LogLevel debug

</VirtualHost>

但现在出现了一个奇怪的问题:当我访问a.example.com时,链接末尾会自动被加上204,导致无法正常加载b.example.com的内容。有没有哪位前辈能帮我分析下问题可能出在哪里,或者该怎么调整配置解决这个问题?

备注:内容来源于stack exchange,提问作者Cooper Max

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.15 12:54:28