Nginx causes redirects when server root is changed

Francis Daly francis at daoine.org
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 http://myserver.co.in:81/index.php.
> 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 http://myserver.co.in:81/index.php

? 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,

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list