Nginx causes redirects when server root is changed

Francis Daly francis at
Tue Jul 31 17:33:08 UTC 2012

On Tue, Jul 31, 2012 at 03:06:58AM -0400, yashgt wrote:

Hi there,

> My application is installed at 
> /usr/share/nginx/www/magento/current
> When I access
> http://myserver:81/magento/current/index.php
> it works fine. This is because the server root is set to
> /usr/share/nginx/www;
> Now I want to acces the app using
> When I change the server root to /usr/share/nginx/www/magento/current
> and type the above URL, it REDIRECTS with http 302 to 
> http://myserver:81/magento/current. 
> What might be the reason for this?

Might it be the application doing the redirect, and not nginx?

What is the output from running the command

  curl -i

? Does it include anything like "X-Powered-By: PHP"?

>From your configuration, I see no obvious reason why nginx should be
issuing the redirect.

If it *is* the application, then you'll probably want to configure it
to do what you want it to do.

Good luck with it,

Francis Daly        francis at

More information about the nginx mailing list