WebSphere Portal behind reverse proxy and getServe

2019-04-01 22:32发布

I have problems accessing WebSphere Portal which is deployed behind reverse proxy (using Apache). The problem is that while inspecting HTTP requests issued by browser, some requests are targeted at proxy, and some directly at WebSphere Portal.

My Apache configuration:

ProxyPassReverseCookieDomain backend-server proxy-server

ProxyPass / http://backend-server:10039/
ProxyPassReverse / http://backend-server:10039/

The problem is, some generated resources contained absolute URIs targeting at backend-server:10039...

What else should I configure to properly access WebSphere Portal behind reverse proxy?

2条回答
爷、活的狠高调
2楼-- · 2019-04-01 23:14

Because I can answer my own questions, here's what the problem was:

At server-side, portlets and JSPs in WebSphere Portal use request.getServerHost() and request.getServerPort(). To make these methods work behind reverse proxy (which sends Host: header). I had to add:

ProxyPreserveHost On

to apache configuration and:

com.ibm.ws.webcontainer.extractHostHeaderPort = true
trusthostheaderport = true

additional properties to Web Container in IBM Console: WebSphere application servers -> WebSphere_Portal -> Web Container Settings -> Web Container -> Custom properties.

These properties are described here.

查看更多
我欲成王,谁敢阻挡
3楼-- · 2019-04-01 23:15

I got the same problem few days ago and eventually chose the apache mod_substitute to change these urls with something like this:
Substitute "s|http ://backend-server:10039/|/|i"

查看更多
登录 后发表回答