On WebLogic 11G I can use the console to set the FrontendHost and FrondendPort on a server or on a cluster so that re-directs are handled correctly and end up resolving to the front end load balancer instead of the local host.

The MBeans associated with this on WebLogic are, for example:

MBean Name  com.bea:Name=AdminServer,Type=WebServer,Server=AdminServer
Attribute Name  FrontendHost
Description The name of the host to which all redirected URLs will be sent. If specified, WebLogic Server will use this value rather than the one in the HOST header.
Sets the HTTP frontendHost Provides a method to ensure that the webapp will always have the correct HOST information, even when the request is coming through a firewall or a proxy. If this parameter is configured, the HOST header will be ignored and the information in this parameter will be used in its place.
Type    java.lang.String
Readable / Writable RW

How is the same thing achieved under Websphere 7?

Follow up info:

So I have 2 use cases actually.

One is that I have a web app running under WebSphere on host A on port 9002 and a LB running on host B at port 80, when I visit the home page of the app via the LB on http://hostb/app the app redirects my browser to http://hostb:9002/app and it 404's

I think this is WebSphere's fault but I guess it could be the app's fault?

The second is that the web app in question needs to send emails containing URls that the customer can click on to get back into the web app - obviously this needs to be via the LB. On WebLogic the app uses MBeans to derive the LB url and I was hoping to use a similar mechanism on WebSphere.

  • What do you have in front of WebSphere? And what kind of load balancer, balancing at what level? Sorry I'm a little vague, but trying to understand your specific environment, as I think that will affect the answer. At some point you have an external IP name that you then change into an internal one, correct? In our case, we have a reverse proxy that makes that transformation, and that's where we make the corresponding transformation to redirect Location headers, not in WebSphere. That is, WebSphere only knows about its own host name. – dbreaux Apr 27 '12 at 14:27
  • @dbreaux Thanks for the comment - I have added some additional info to the Q. My LB is HAProxy - i'm just trying to test the app works via a LB on WS. – TiGz Apr 27 '12 at 15:21
  • Sorry, I don't know how HAProxy works. How does hostb:80 specify to hit hosta:9002? Does it actually change the Host header in the process, or transfer the message at a lower level of the IP stack? Do you have hostb:80 in your WebSphere virtual host alias list? But you are seeing a redirect to hostb:9002, not hosta:9002, correct? – dbreaux May 11 '12 at 19:59

WebSphere uses private headers to communicate the frontend Host header back to the AppServer -- just fire up a webserver + WAS Plugin, set the plugin logging level to TRACE, and look at what's passed in the various $WSxx headers.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.