`

tomcat read correct request server name behand apache

    博客分类:
  • web
 
阅读更多

I need read requested server name in jsp (tomcat container), because tomcat is behind apache, and apache use proxypass, so the tomcat can only read request.getServerName() got 'localhost'.

 

We can pass correct hostname by setting apache configuration: proxyPreserveHost on.

 

more infomation see: http://httpd.apache.org/docs/2.0/mod/mod_proxy.html#proxypreservehost

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics