Welcome! Log In Create A New Profile

Advanced

Re: rewrite Location header?

Igor Sysoev
February 03, 2010 09:28AM
On Wed, Feb 03, 2010 at 08:50:33AM -0500, 3molo wrote:

> Hi.
>
> Running nginx as a reverse proxy for trac. Reaching trac etc works, but when posting login credentials, trac returns a Location: header as seen below.
>
> POST /somesite/login HTTP/1.1
> Host: dev.somesite.co.za:8001
> Referer: http://dev.somesite.co.za:8001/somesite/login
> __FORM_TOKEN=ec42989d17edbcdec96290d6&referer=http%3A%2F%2Fdev.somesite.co.za%3A8001%2Fsomesite&user=user&password=pass
> -
> HTTP/1.x 303 See Other
> Server: tracd/0.11.6 Python/2.5.2
> Date: Wed, 03 Feb 2010 13:37:16 GMT
> Location: http://dev.somesite.co.za:8001/somesite
>
> This is the case when going through nginx too, but I now need to rewrite the Location response header to http://ip_to_nginx:port/ instead, as the trac server is not reachable from the outside.
> Im kind of stuck :(
>
> Here's the simple proxy_pass config:
> location /somesite {
> proxy_pass http://192.168.1.9:8001/somesite;
> }

You should add
proxy_redirect http://dev.somesite.co.za:8001/ /;


--
Igor Sysoev
http://sysoev.ru/en/

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

rewrite Location header?

3molo February 03, 2010 08:50AM

Re: rewrite Location header?

Igor Sysoev February 03, 2010 09:28AM

Re: rewrite Location header?

3molo February 03, 2010 09:40AM

Re: rewrite Location header?

3molo February 03, 2010 09:41AM

Re: rewrite Location header?

Igor Sysoev February 03, 2010 10:04AM

Re: rewrite Location header?

3molo February 04, 2010 01:20AM

Re: rewrite Location header?

3molo February 04, 2010 01:27AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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