Nginx and Websphere

Francis Daly francis at daoine.org
Fri May 29 07:33:13 UTC 2015


On Fri, May 29, 2015 at 02:01:00AM -0400, sampy wrote:

Hi there,

> Now it's near to work!

Good news.

> With this configuration:
> 
> upstream webint {
>                 #ip_hash;
>                 server wasint-1.domain.com:9080;
>                 server wasint-2.domain.com:9080;
>         }
> 
>     server {
> 
>         listen 80;
>         server_name web.domain.com;
> 
>         location /WebApp {
>                 #proxy_set_header Host $host;
>                 proxy_set_header X-Real-IP $remote_addr;
>                 proxy_set_header X-Forwarded-For
> $proxy_add_x_forwarded_for;
>                 proxy_pass http://webint;
>                 proxy_redirect http://webint/ /;
>                 proxy_redirect http://webint:9080/ /;
>         }

You probably do not need "proxy_redirect http://webint/ /;", because
what the upstream sends back probably always includes the :9080. But it
does no extra harm to leave it there.

> executing "curl -i http://web.domain.com/WebApp/main.js"
> 
> Shows the web!!
> 
> And y a normal browser typing all the url
> "http://web.domain.com/WebApp/main.jsf" shows the correct web!! awesome!
> 
> Now I want to modify the base of this configuration to type only
> http://web.domain.com and redirect to the web I want.

Add an extra location block for that request:

  location = / { return 301 /WebApp/; }

And then issue the "curl" command for the url you want; when you get a
301 redirect, issuer a curl command for the Location: header returned.

If the Location: header looks wrong -- does not point at something in
web.domain.com -- then you'll have identified which request leads to
the unwanted response.

Good luck with it,

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list