apache httpd替代品将无法正常工作

ste*_*ert 3 apache

我将apache httpd配置为应用替代。在我看来,这正是医生所说的。但是,它根本不执行任何操作。

怎么了

<VirtualHost domain:443>
    SSLEngine on
    ....

    ProxyPass /cms/ http://domain2/
    ProxyPassReverse /cms/ http://domain2/
    Substitute "s|div|DIV|ni"
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

(Centos上的Apache 2.4.16)

ste*_*ert 5

同时我想出了如何使其工作的方法

<VirtualHost domain:443>
    SSLEngine on
    ....
# In some case the following line is neccessary
    RequestHeader unset Accept-Encoding

    <Location /cms >
         ProxyPass http://domain2/
         ProxyPassReverse http://domain2/
         AddOutputFilterByType SUBSTITUTE text/html
         Substitute "s|div|DIV|ni"
    </Location>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

我希望这可以帮助其他人克服类似的问题。

(经过艰苦的工作,Apache httpd是一个很棒的工具,我们用它来交换代理来源的网址;-))

  • 谢谢,我在这上面花了很多时间。RequestHeader 未设置对我来说就是这样。 (2认同)