作为代理服务器运行时的Apache服务器状态

我们运行Apache作为代理服务器,并在Apache后面有tomcat。 我们正在使用server_status模块,但是当我们尝试访问server_status在https://host.com/server-status它redirect到tomcat,我们得到404错误。 我对此很新,尝试通过Apache文档,但无法找出解决scheme。 Fyi.We启用了ssl

当前的ssl.conf设置:

  ProxyRequests Off ProxyPreserveHost On <Proxy http://localhost:8081/*> Order deny,allow Allow from all </Proxy> ProxyPass / http://localhost:8081/ ProxyPassReverse / http://localhost:8081/ ProxyPassReverse / http://myhost:8081/ <Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from 10.90 </Location> 

build议更改后

  ProxyRequests Off ProxyPreserveHost On <Proxy http://localhost:8081/*> Order deny,allow Allow from all </Proxy> ProxyPass /server-status ! ProxyPass / http://localhost:8081/ ProxyPassReverse / http://localhost:8081/ ProxyPassReverse / http://myhost:8081/ 

编辑2:

httpd.conf需要更改,我添加了ProxyPass /server-status ! 在代理模块configuration的指令下工作。

你可以用! 在代理exception的ProxyPass指令中。 就像是

 ProxyPass /server-status ! 

应该这样做。

有关更多信息,请参阅apache docs for ProxyPass指令: http : //httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass ,尤其

那! 指令在你不想反向代理一个子目录的情况下很有用,例如

我有很多网站,其中一些有“redirect永久”的。 由于某种原因,它不起作用(至less对我而言)。

我使用/服务器状态进行监控,所以我只需要从本地局域网内的另一台服务器连接到它。 所以我创build了一个额外的Vhost与本地IP作为ServerName是这样的:

 <VirtualHost *:80> ServerName <<local_server_ip>> ServerAlias <<local_server_ip>> ServerAdmin [email protected] DocumentRoot "/var/www/html" Options Indexes FollowSymLinks </VirtualHost> 

我不是专家,但它为我工作。