Nginx and Websphere

sampy nginx-forum at nginx.us
Fri May 29 06:01:00 UTC 2015


Hi there!

Now it's near to work!

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/ /;
        }

    }

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.

Thanks for all!!! I can feel that we are near to resolve that :-)



Francis Daly Wrote:
-------------------------------------------------------
> On Thu, May 28, 2015 at 11:50:30AM -0400, sampy wrote:
> > Francis Daly Wrote:
> 
> Hi there,
> 
> >  upstream webint {
> >                 ip_hash;
> >                 server wasint-1.carreras.sa;
> 
> Just to confirm: no ":9080" on that one? It probably means that a
> second
> proxy_redirect will be needed; added below.
> 
> >                 server wasint-2.carreras.sa:9080;
> >         }
> > 
> >     server {
> > 
> >         listen 80;
> >         server_name web.domain.com;
> > 
> > 
> >         location / {
> >                 #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_redirect http://webint/WebApp /;
> >                 proxy_redirect http://webint /;
> 
> There is no "proxy_pass" here, so the rest of the configuration is
> effectively unused and the request is served from the filesystem --
> which explains the responses you get.
> 
> Perhaps try instead
> 
>   location / {
>     proxy_pass http://webint;
>     proxy_redirect http://webint/ /;
>     proxy_redirect http://webint:9080/ /;
>   }
> 
> and add the other bits if they are needed.
> 
> > >  curl -i http://web.domain.com/
> > result: default nginx web
> 
> That should become "whatever the webapp returns for a / request". If
> it
> is not a redirect to /WebApp/, it can be fixed later.
> 
> > >  curl -i http://web.domain.com/WebApp/
> > result:
> 
> That should become a sensible response -- hopefully a redirect to
> http://web.domain.com/WebApp/main.jsf.
> 
> If you do get that, they you can try
> 
>   curl -i http://web.domain.com/WebApp/main.jsf
> 
> to see what happens next; or just try it in your normal browser.
> 
> 	f
> -- 
> Francis Daly        francis at daoine.org
> 
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,259127,259253#msg-259253



More information about the nginx mailing list