Welcome! Log In Create A New Profile

Advanced

Re: Multiple Upstream Servers Result in Error 310 (net::ERR_TOO_MANY_REDIRECTS)

March 06, 2012 04:48PM
On 03/06/2012 01:08 PM, mevans336 wrote:
> I have an Nginx reverse-proxy sitting in front of two JBoss servers. If
> I attempt to add the second JBoss server to the upstream directive, I
> receive an Error 310 (net::ERR_TOO_MANY_REDIRECTS) from Chrome, IE just
> displays an "Internet Explorer cannot display this webpage" error. If I
> comment the second upstream server out a kill -HUP the master process,
> everything works properly.
>
> I am attempting to use Nginx to rewrite all HTTP requests to HTTPS and
> upon first contact with our domain, the JBoss application redirects you
> to https://my.domain.com/home.
> server {
> listen 10.0.3.28:80;
> server_name my.domain.com;
> location / {
> proxy_set_header Host $host;
> proxy_set_header X-Real-IP $remote_addr;
> proxy_next_upstream error timeout invalid_header;
> rewrite ^ https://$server_name$request_uri? permanent;
> proxy_pass http://jboss_dev_servers;
> }
> }

Why does the application do a redirect if you are already doing one in
your Nginx config? It's not clear why you even bother with the
proxy_pass in this location. Just redirect to the HTTPS location and be
done.

Also, be sure the application is properly detecting the scheme. In
your config, Nginx is talking to JBoss via HTTP, not HTTPS, so you may
have some issue there, something like proxy_set_header X-Scheme $scheme;
would do the trick.

I have no idea why this would work with a single backend and not two,
unless you are somehow inadvertently running two different versions of
the JBoss code (one with a redirect, one without).

Regards,
Cliff

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Multiple Upstream Servers Result in Error 310 (net::ERR_TOO_MANY_REDIRECTS)

mevans336 March 06, 2012 04:08PM

Re: Multiple Upstream Servers Result in Error 310 (net::ERR_TOO_MANY_REDIRECTS)

Cliff Wells March 06, 2012 04:48PM

Re: Multiple Upstream Servers Result in Error 310 (net::ERR_TOO_MANY_REDIRECTS)

mevans336 March 06, 2012 05:07PM

Re: Multiple Upstream Servers Result in Error 310 (net::ERR_TOO_MANY_REDIRECTS)

Cliff Wells March 06, 2012 08:00PM

Re: Multiple Upstream Servers Result in Error 310 (net::ERR_TOO_MANY_REDIRECTS)

Francis Daly March 06, 2012 05:08PM

Re: Multiple Upstream Servers Result in Error 310 (net::ERR_TOO_MANY_REDIRECTS)

Cliff Wells March 06, 2012 08:14PM

Re: Multiple Upstream Servers Result in Error 310 (net::ERR_TOO_MANY_REDIRECTS)

mevans336 March 07, 2012 07:20AM

Re: Multiple Upstream Servers Result in Error 310 (net::ERR_TOO_MANY_REDIRECTS)

Cliff Wells March 07, 2012 07:54AM

Re: Multiple Upstream Servers Result in Error 310 (net::ERR_TOO_MANY_REDIRECTS)

mevans336 March 08, 2012 09:15AM

Re: Multiple Upstream Servers Result in Error 310 (net::ERR_TOO_MANY_REDIRECTS)

mevans336 March 07, 2012 07:23AM

Re: Multiple Upstream Servers Result in Error 310 (net::ERR_TOO_MANY_REDIRECTS)

Francis Daly March 08, 2012 01:52PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 82
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready