Apache:Proxy 2到同一域上不同端口的URL

时间:2017-03-22 03:03:59

标签: apache jenkins solr routing

我有jenkins和solr在机器上运行。 (8080,8081个港口)

我想要一个配置来执行此代理

www.example.com/jenkins =>本地主机:8080 /詹金斯

www.example.com/solr =>本地主机:8081 / solr的

它不起作用。只有詹金斯才有效。索尔没有。

ProxyPass         /solr  http://localhost:8081/solr nocanon
ProxyPassReverse  /solr  http://localhost:8081/solr

apachectl -S

的结果
VirtualHost configuration:

*:80                   is a NameVirtualHost
         default server example.com/jenkins (/etc/apache2/sites-enabled/jenkins.conf:1)
         port 80 namevhost example.com/jenkins (/etc/apache2/sites-enabled/jenkins.conf:1)
         port 80 namevhost example.com/solr (/etc/apache2/sites-enabled/solr.conf:1)
.

solr.conf文件

<Virtualhost *:80> 
ServerName example.com/solr 
DocumentRoot /var/www/solr/public_html 
ProxyRequests Off 
ProxyPreserveHost On 
AllowEncodedSlashes NoDecode 

<Proxy http://localhost:8081/*>
 Order deny,allow Allow from all 
</Proxy> 

ProxyPass /solr http://localhost:8081/solr nocanon 
ProxyPassReverse /solr http://localhost:8081/solr 

</Virtualhost>

0 个答案:

没有答案