Changes between Initial Version and Version 2 of Ticket #2455


Ignore:
Timestamp:
02/25/23 17:29:24 (21 months ago)
Author:
RuStrannik@…
Comment:

Thank you for posting patch so quickly.

Can confirm, 'return 200' actually works on 'nginx/1.23.1', my bad, sorry. Was also testing this issue on a different server with 'nginx/1.22.0' and 'return 200' does not work there.

Regarding the configuring error pages, I wanted to minimize server exposure and minimize resources spent on processing requests from scripts and scanners, especially to malformed ones, as there is absolutely no value in doing that.

Have not tested patched and recompiled nginx yet.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2455

    • Property Status newaccepted
  • Ticket #2455 – Description

    initial v2  
    1 **Problem**: when built-in error '400' redirected to custom handler, and used incorrect request method along with invalid/absent 'Host:' header, nginx does not perform any actions, just hangs keeping connection open.
     1**Problem**: when built-in error '400' redirected to custom handler, and used incorrect request method, nginx does not perform any actions, just hangs keeping connection open.
    22
    3 **Expected behaviour**: error handler redirected and either connection closed without response (case A) of specified response served and connection closed( case B).
     3**Expected behaviour**: error handler redirected and either connection closed without response (case A) of specified response returned and connection closed as well (case B).
    44
    55Server config:
    66{{{
    77server {
    8         listen 443 default_server;
    9         listen [::]:443 default_server;
     8        listen 443 ssl http2 default_server;
     9        listen [::]:443 ssl http2 default_server;
    1010
    1111        include snippets/snakeoil.conf;
    1212
    1313        error_page 400 /drop;
     14        #error_page 400 =200 /drop; # makes no difference
    1415        # Case 'A'
    1516        location = /drop { return 444; }
     
    1718        #location = /drop { return 200 "error\n"; } # doesn't work either
    1819
    19         location / { return 200 "server ok!"; }
     20        location / { return 200 "server ok!\n"; }
    2021}
    2122}}}
     
    6768<now hangs here infinitely>
    6869}}}
     70
     71''UPD: fixed typos and removed unrelated condition.''