Absolute path for error_page in nginx?
Asked Answered
A

1

9

Is there a way I can set an absolute path for nginx error_pages? Not absolute as in http://, but absolute as in /usr/var/nginx/errors/500.html.

Anorthic answered 25/2, 2013 at 23:2 Comment(0)
V
17

Sure you can but in an indirect way:

error_page 500 /500.html;
location = /500.html {
       root   /usr/var/nginx/errors;
       allow all;
       internal;
}

see http://wiki.nginx.org/HttpCoreModule#error_page

Valene answered 26/2, 2013 at 0:46 Comment(1)
@magu official docs says it works in http context too. What version of nginx you are using?Valene

© 2022 - 2024 — McMap. All rights reserved.