Welcome! Log In Create A New Profile

Advanced

Re: multiple error_pages in one directory - with one location - not possible?

Sven 'Darkman' Michels
July 31, 2011 09:44AM
Hi,

Am 31.07.2011 15:15, schrieb Maxim Dounin:
> Path to file is produced as <root> + <uri>. In your case <uri> is
> "/status/503.html", so expected file path is
> "/var/www/statuspages/status/503.html". Do you actually have this
> file?

Nope...


> From what you wrote it looks like you instead have
> "/var/www/statuspages/503.html" file. Using "alias" directive
> instead of "root" should resolve your problem.

Yeah, you're right :/ My fault. Didn't think about because i copied it
from another block i use, but since there is only one status page,
the setup was slightly different and worked.


> Note well: nginx should log error to error_log if it isn't able to
> find requested file; looking into error_log is always a good idea.

Well, i did that. But it only logs directory index of "/var/www/webroot/" is
forbidden" - nothing about the missing error page. But i got a 404 in the
accesslog, but i thought this was due to the fact that the location didn't work.

Anyway, changeing root to alias and location ^~ /status/ { internal;
alias /var/www/statuspages/; } did the trick.

Thanks a lot for the enlightenment ;)

Best regards,
Sven

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

multiple error_pages in one directory - with one location - not possible?

Sven 'Darkman' Michels July 31, 2011 08:58AM

Re: multiple error_pages in one directory - with one location - not possible?

Maxim Dounin July 31, 2011 09:16AM

Re: multiple error_pages in one directory - with one location - not possible?

Sven 'Darkman' Michels July 31, 2011 09:44AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 82
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready