Welcome! Log In Create A New Profile

Advanced

error_page directive, how does context affect error handling behavior?

February 26, 2012 01:50PM
Hello,

I'm using nginx 1.1.14 on Debian Squeeze.

In /etc/nginx.conf I wrote:
error_page 404 http://google.com;

That error_page directive is written in the http context.

So far so good, when I visit http://mydomain.com/foo.txt and foo.txt
doesn't exist in root's folder, I'm getting redirected to http://google.com as
per the 404 error handling.

However, if in my server context, inside /etc/sites-available/default, I
write:
error_page 418 http://nginx.org;

Then 404 error handling from http's context doesn't work anymore. When I
visit http://mydomain.com/foo.txt I'm not redirected to http://google.com as
before but I see nginx's default 404 error page "404 Not found".

here is my nginx.conf: http://pastebin.com/5nffYFvK
and my default site conf: http://pastebin.com/CYcEFnwx

Is there something I overlooked about nginx's error_page directive?

Thank you in advance for any help.
Gregory
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

error_page directive, how does context affect error handling behavior?

gpakosz February 26, 2012 01:50PM

Re: error_page directive, how does context affect error handling behavior?

Max February 26, 2012 05:16PM

Re: error_page directive, how does context affect error handling behavior?

gpakosz February 27, 2012 09:22AM

Re: error_page directive, how does context affect error handling behavior?

Maxim Dounin February 27, 2012 10:04AM

Re: error_page directive, how does context affect error handling behavior?

gpakosz February 27, 2012 11:08AM

Re[2]: error_page directive, how does context affect error handling behavior?

Max February 27, 2012 10:54PM

Re: error_page directive, how does context affect error handling behavior?

Maxim Dounin February 28, 2012 04:04AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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