port_in_redirect not working?

olan nginx-forum at nginx.us
Mon Nov 7 18:25:44 UTC 2011

Hi Maxim, thanks for getting back to me.

I've enabled debugging and the output is here:
http://pastebin.com/Dmw2nJMY. I've cleared all caches and restarted
varnish, nginx and php5-fpm and mysql.

I didn't explain myself very well earlier. The "fastcgi_param
SERVER_PORT 80" does work for php pages (it's in my location ~ .php$
block) but the problem I'm having is with my server root.

http://site.com/page.php <-- works fine
http://site.com/ redirects to http://site.com:8080
http://site.com/index.php redirects to http://site.com:8080

One thing I noticed is "location /" block is used first, the index.php
is tried, and then the "location ~ .php$" block processes this page. I
would have thought that the SERVER_PORT would have rewritten the port
used at this stage...?

Any help is greatly appreciated!


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

More information about the nginx mailing list