Welcome! Log In Create A New Profile

Advanced

Re: How to fix nginx server returning 302 redirect instead of 200

Richard Stanway
December 19, 2015 12:08PM
This doesn't seem to be an nginx issue. The presence of the "X-Powered-By:
HHVM/3.11.0" in your response means your backend is the one issuing the 302
redirect, so you should investigate that instead of nginx.

On Sat, Dec 19, 2015 at 5:11 PM, Xavier Cardil Coll <info@elsitar.com>
wrote:

> On this setup, there is a server directive listening to port 80 that
> returns www to non www and returns 80 to 443.
>
> The second server is Nginx as SSL terminator, so it's an SSL virtual host,
> that proxies the request to Varnish, and the last server is the last host
> on the chain, that processes and serves back the requests.
>
> Now, when I bypass the chain and do a `curl -v 127.0.0.1:8081` ( this is
> the backend vhost, the last in the chain ) I get a 302 redirect instead a
> 200. This is causing problems on my CMS and also with Varnish communicating
> to the backend.
>
> This is the curl response :
>
> * Rebuilt URL to: 127.0.0.1:8081/
> * Hostname was NOT found in DNS cache
> * Trying 127.0.0.1...
> * Connected to 127.0.0.1 (127.0.0.1) port 8081 (#0)
> > GET / HTTP/1.1
> > User-Agent: curl/7.38.0
> > Host: 127.0.0.1:8081
> > Accept: */*
> >
> < HTTP/1.1 302 Found
> * Server nginx/1.9.9 is not blacklisted
> < Server: nginx/1.9.9
> < Date: Sat, 19 Dec 2015 16:04:14 GMT
> < Content-Type: text/html
> < Transfer-Encoding: chunked
> < Connection: keep-alive
> < X-Powered-By: HHVM/3.11.0
> < Vary: Accept-Encoding
> < Location: https://domain.com
> <
> * Connection #0 to host 127.0.0.1 left intact
>
>
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

How to fix nginx server returning 302 redirect instead of 200

Xavier Cardil Coll December 19, 2015 11:12AM

Re: How to fix nginx server returning 302 redirect instead of 200

Richard Stanway December 19, 2015 12:08PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 135
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