7
有没有一种方法可以为nginx error_pages设置绝对路径?不是绝对的,如http://
,但绝对如/usr/var/nginx/errors/500.html
。nginx中error_page的绝对路径?
有没有一种方法可以为nginx error_pages设置绝对路径?不是绝对的,如http://
,但绝对如/usr/var/nginx/errors/500.html
。nginx中error_page的绝对路径?
当然,你可以,但以间接的方式:
error_page 500 /500.html;
location = /500.html {
root /usr/var/nginx/errors;
allow all;
internal;
}
请注意,这不会里面'http'块工作。 – 2015-05-28 02:28:17
@magu [官方文档](http://nginx.org/en/docs/http/ngx_http_core_module.html#error_page)表示它也可以在'http'上下文中使用。你使用的是什么版本的nginx? – number5 2015-05-28 04:56:45
'error_page'起作用。 '位置'不。 – 2015-05-30 06:00:04