Welcome! Log In Create A New Profile

Advanced

large_client_header_buffers: Custom error pages are not working

June 05, 2018 05:34AM
Hi there,
I'm using nginx nginx version 1.12.0 as a reverse proxy to my application servers.
I allow certain top level checks like header size and count to be done at nginx level.

The server block looks like the following:

server {
listen 443 ssl default_server;
..
large_client_header_buffers 32 512;
..
location / {
...
}

error_page 400 /400.json;
location = /400.json {
root /etc/nginx/errors-files/;
allow all;
internal;
}

}

Then I start testing the nginx with curl and adding a header of size 600 bytes.
nginx promptly stops the request and dumps a default error page instead of my custom error page.

<html>
<head><title>400 Request Header Or Cookie Too Large</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<center>Request Header Or Cookie Too Large</center>
<hr><center>nginx</center>
</body>
</html>


How can I get a CUSTOM ERROR page for this situation working instead of the default page.
Thanks
Cheers
prajos
Subject Author Posted

large_client_header_buffers: Custom error pages are not working

prajos June 05, 2018 05:34AM

Re: large_client_header_buffers: Custom error pages are not working

Maxim Dounin June 05, 2018 07:46AM

Re: large_client_header_buffers: Custom error pages are not working

prajos June 05, 2018 09:14AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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