Welcome! Log In Create A New Profile

Advanced

Re: Nginx and Websphere

May 29, 2015 12:51PM
Francis Daly Wrote:
-------------------------------------------------------
> 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@daoine.org
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

hi there.

I'm happy because with web.domain.com/WebApp works fine.

But when I change LOCATION from:

location /WebApp {
upstream balancer {
server server1.domain.com:9080;
server server2.domain.com:9080;
}

location /WebApp {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://balancer/WebApp;
proxy_redirect http://balancer:9080/ /;
}
}

}


to:
upstream balancer {
server server1.domain.com:9080;
server server2.domain.com:9080;
}


location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://balancer/WebApp;
proxy_redirect http://balancer:9080/ /;
}

}

stop working. "curl" sees the 302 redirection in both cases, but the web is not showed in the second case. I think I forget something or I have some mistake in syntax.

Regards
Subject Author Posted

Nginx and Websphere

sampy May 26, 2015 06:36AM

Re: Nginx and Websphere

Francis Daly May 26, 2015 07:40PM

Re: Nginx and Websphere

sampy May 27, 2015 07:27AM

Re: Nginx and Websphere

Francis Daly May 27, 2015 09:34AM

Re: Nginx and Websphere

sampy May 28, 2015 02:35AM

Re: Nginx and Websphere

Francis Daly May 28, 2015 03:50AM

Re: Nginx and Websphere

sampy May 28, 2015 04:15AM

Re: Nginx and Websphere

Francis Daly May 28, 2015 07:34AM

Re: Nginx and Websphere

sampy May 28, 2015 11:50AM

Re: Nginx and Websphere

Francis Daly May 28, 2015 02:02PM

Re: Nginx and Websphere

sampy May 29, 2015 02:01AM

Re: Nginx and Websphere

Francis Daly May 29, 2015 03:34AM

Re: Nginx and Websphere

sampy May 29, 2015 12:51PM

Re: Nginx and Websphere

Francis Daly May 29, 2015 05:46PM

Re: Nginx and Websphere

Ravikiran Siddhanti May 29, 2015 10:44PM

Re: Nginx and Websphere

unclepieman May 28, 2015 02:36PM

Re: Nginx and Websphere

sampy May 29, 2015 12:53PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 334
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready