Welcome! Log In Create A New Profile

Advanced

error_page behavior

B.R.
April 04, 2016 03:38PM
Hello,

I am struggling to understand the error_page directive behavior:

​server {
listen 80;
listen [::]:80;
server_name example.org;

location /proxied {
return 418 "Host: $host, Connection: $http_connection";
}
}

server {
listen 80;
listen [::]:80;
server_name example.com;

root /var/ious/files;

error_page 418 = /error_page.html;
proxy_intercept_errors on;

location /proxy {
proxy_pass http://example.org/proxied;
}
}

​Expected behavior:
->Request to http://example.com/proxy
-> Sub-request to http://example.org/proxied
-> Response HTTP 418
-> Error page for HTTP 418 served http://example.com/error_page.html

Observed behavior:
-> Request to http://example.com/proxy
-> Sub-request to http://example.org/proxied
-> Response HTTP 418
-> Error page HTTP 404 (???)

​The error_page.html​ file exists in the example.com root directory as any
other file.
No error message in the error_log file (warn level).

​I am running​ nginx v1.8.1.

​What am I doing/understanding wrong?​
---
*B. R.*
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

error_page behavior

B.R. April 04, 2016 03:38PM

Re: error_page behavior

Francis Daly April 04, 2016 03:56PM

Re: error_page behavior

Francis Daly April 04, 2016 04:14PM

Re: error_page behavior

B.R. April 04, 2016 04:52PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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