Score:0

Nginx error page not working vs transfer-encoding: chunked

pk flag
lxs

I've configured an error page in Nginx:

error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 421 422 423 424 425 426 428 429 431 451 495 496 497 500 501 502 503 504 505 506 507 508 510 511 /error.html;
location = /error.html {
  ssi on;
  internal;
  auth_basic off;
  root /etc/nginx;
}

This works fine for 404. However I'm submitting a request like this:

POST /graphql HTTP/1.1
Content-Length: 2
Transfer-Encoding: chunked
Connection: close

{}

Note Transfer-Encoding: chunked. Nginx returns a 400 Bad Request error page of its own instead of mine. One minor clue is that the footer only says "nginx", it doesn't include a version. I tried adding "server_tokens off;" and it didn't change anything.

What config do I need to add to make Nginx use my error page for ALL errors, please?

pk flag
lxs
Raised https://trac.nginx.org/nginx/ticket/2304
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.