Francis Daly
March 23, 2011 02:10PM
On Wed, Mar 23, 2011 at 01:16:14PM -0400, chatfeed wrote:

Hi there,

> I wrote as the following site.

Despite what it shows on that page, it is usually best...

> server_name *; # Alternately: _
> root /data/www/$host/;
> error_page 404 errors/404.html;

....if the last argument to error_page starts with "/" or "@".

So make it "/errors/404.html" and you should see something more
useful. (Or just remove the line entirely, for a slightly different

> when i vist
> but the website redirect to the following site.
> http://a.domaincom/errors/errors/errors/errors/errors/errors/errors/errors/errors/errors/errors/errors/errors/errors/errors/errors/errors/errors/errors/errors/errors/404.html

You ask for; nginx presumably doesn't see the file
/data/www/ and so generates a http 404 error; your
error_page setting says "do an external redirect to errors/404.html",
which is returned to your browser.

It then asks for; nginx doesn't see
the file /data/www/ and generates a http
404 error which becomes an external redirect, so your browser asks for; and this continues until
your browser decides it has seen too many redirects.

So: delete or change the error_page line to prevent the loop; and add
content to the right directory to avoid the initial 404 error.

Good luck with it,

Francis Daly

nginx mailing list
Subject Author Posted

problem with setting Virtual Hosts

chatfeed March 23, 2011 01:16PM

Re: problem with setting Virtual Hosts

Francis Daly March 23, 2011 02:10PM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

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