【发布时间】:2014-06-04 22:37:13
【问题描述】:
假设我有一个名为“stackoverflow.com”的域名
我有 apache tomcat 7 运行上下文根为 /mainsite 的应用程序 我可以在本地以http://stackoverflow.com:8080/mainsite 的身份访问它 Apache tomcat 在 8080 端口上运行。
我有 apache Web 服务器在端口号 80 上运行另外两个 PHP 应用程序 Apache 应用程序之一是 blog 另一个 apache 应用程序是论坛
我访问博客的网址是“https://stackoverflow.com/blog” 我访问论坛的网址是“https://stackoverflow.com/forum”
我想将所有带有 https://stackoverflow.com/* 之类 url 的请求发送到 tomcat 上的主站点 任何带有https://stackoverflow.com/blog 或https://stackoverflow.com/forum 的url 都将由apache 提供。
请告诉我该怎么做。
我在 httpd.conf 中尝试过这样的事情 但它会将每个呼叫发送到 /mainsite。
ProxyPass /blog https://stackoverflow.com/wordpress-3.8.2/wordpress/
ProxyPassReverse /blog https://stackoverflow.com/wordpress-3.8.2/wordpress/
ProxyPass /forum http://localhost/phpBB3/
ProxyPassReverse /forum http://localhost/phpBB3/
ProxyPass / http://localhost:8080/mainsite/
ProxyPassReverse / http://localhost:8080/mainsite/
提前感谢您的帮助。
【问题讨论】:
标签: mod-rewrite mod-proxy