【发布时间】:2019-11-27 09:35:23
【问题描述】:
我对服务器没有太多经验。所以,这可能是一个愚蠢的问题。目前在我的 Apache 服务器 vim /etc/apache2/sites-enabled/000-default.conf 文件中,我有一个如下的 proxypass。
ProxyPass /phpmyadmin !
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
我想为以下场景实现条件代理传递
如果网址中包含?_escaped_fragment_=,如以下网址
http://localhost/web/?_escaped_fragment_=/health
我希望将此 URL 重定向到具有不同端口的 URL,例如下面的 URL,
http://localhost:8082/web/?_escaped_fragment_=/health
如果网址不包含?_escaped_fragment_=,如下面的网址,
http://localhost/web/#!/health
我之前提到的重定向到端口 8080 的代理传递应该会发生。这是什么代码?
【问题讨论】:
-
什么是apache版本?
-
搜索apache conditional proxypass 会得到serverfault.com/questions/625426/…,也许这会有所帮助。
-
嗨,我的 apache 版本是 Apache/2.4.7
标签: apache .htaccess proxypass