Index: src/http/ngx_http_special_response.c =================================================================== --- src/http/ngx_http_special_response.c (revision 4615) +++ src/http/ngx_http_special_response.c (working copy) @@ -210,13 +210,21 @@ ; -static char ngx_http_error_494_page[] = +static char ngx_http_error_429_page[] = "" CRLF -"
request header fields too large." ; @@ -298,6 +306,16 @@ ; +static char ngx_http_error_511_page[] = +"" CRLF +"
You need to " +"authenticate with the local network in order to gain access." +; + + static ngx_str_t ngx_http_error_pages[] = { ngx_null_string, /* 201, 204 */ @@ -334,11 +352,25 @@ ngx_string(ngx_http_error_414_page), ngx_string(ngx_http_error_415_page), ngx_string(ngx_http_error_416_page), + ngx_null_string, /* 417 */ + ngx_null_string, /* 418 */ + ngx_null_string, /* 419 */ + ngx_null_string, /* 420 */ + ngx_null_string, /* 421 */ + ngx_null_string, /* 422 */ + ngx_null_string, /* 423 */ + ngx_null_string, /* 424 */ + ngx_null_string, /* 425 */ + ngx_null_string, /* 426 */ + ngx_null_string, /* 427 */ + ngx_null_string, /* 428 */ + ngx_string(ngx_http_error_429_page), + ngx_null_string, /* 430 */ + ngx_string(ngx_http_error_431_page), -#define NGX_HTTP_LAST_4XX 417 +#define NGX_HTTP_LAST_4XX 432 #define NGX_HTTP_OFF_5XX (NGX_HTTP_LAST_4XX - 400 + NGX_HTTP_OFF_4XX) - ngx_string(ngx_http_error_494_page), /* 494, request header too large */ ngx_string(ngx_http_error_495_page), /* 495, https certificate error */ ngx_string(ngx_http_error_496_page), /* 496, https no certificate */ ngx_string(ngx_http_error_497_page), /* 497, http to https */ @@ -352,9 +384,13 @@ ngx_string(ngx_http_error_504_page), ngx_null_string, /* 505 */ ngx_null_string, /* 506 */ - ngx_string(ngx_http_error_507_page) + ngx_string(ngx_http_error_507_page), + ngx_null_string, /* 508 */ + ngx_null_string, /* 509 */ + ngx_null_string, /* 510 */ + ngx_string(ngx_http_error_511_page), -#define NGX_HTTP_LAST_5XX 508 +#define NGX_HTTP_LAST_5XX 512 }; @@ -460,7 +496,6 @@ case NGX_HTTP_TO_HTTPS: case NGX_HTTPS_CERT_ERROR: case NGX_HTTPS_NO_CERT: - case NGX_HTTP_REQUEST_HEADER_TOO_LARGE: r->err_status = NGX_HTTP_BAD_REQUEST; break; } Index: src/http/modules/ngx_http_limit_req_module.c =================================================================== --- src/http/modules/ngx_http_limit_req_module.c (revision 4615) +++ src/http/modules/ngx_http_limit_req_module.c (working copy) @@ -245,7 +245,7 @@ ctx->node = NULL; } - return NGX_HTTP_SERVICE_UNAVAILABLE; + return NGX_HTTP_TOO_MANY_REQUESTS; } /* rc == NGX_AGAIN || rc == NGX_OK */ Index: src/http/ngx_http_request.h =================================================================== --- src/http/ngx_http_request.h (revision 4615) +++ src/http/ngx_http_request.h (working copy) @@ -91,16 +91,18 @@ #define NGX_HTTP_UNSUPPORTED_MEDIA_TYPE 415 #define NGX_HTTP_RANGE_NOT_SATISFIABLE 416 +/* RFC 6585 */ +#define NGX_HTTP_TOO_MANY_REQUESTS 429 +#define NGX_HTTP_REQUEST_HEADER_TOO_LARGE 431 + /* Our own HTTP codes */ /* The special code to close connection without any response */ #define NGX_HTTP_CLOSE 444 -#define NGX_HTTP_NGINX_CODES 494 +#define NGX_HTTP_NGINX_CODES 495 -#define NGX_HTTP_REQUEST_HEADER_TOO_LARGE 494 - #define NGX_HTTPS_CERT_ERROR 495 #define NGX_HTTPS_NO_CERT 496 @@ -128,7 +130,10 @@ #define NGX_HTTP_GATEWAY_TIME_OUT 504 #define NGX_HTTP_INSUFFICIENT_STORAGE 507 +/* RFC 6585 */ +#define NGX_HTTP_NETWORK_AUTHENTICATION_REQUIRED 511 + #define NGX_HTTP_LOWLEVEL_BUFFERED 0xf0 #define NGX_HTTP_WRITE_BUFFERED 0x10 #define NGX_HTTP_GZIP_BUFFERED 0x20 Index: src/http/ngx_http_header_filter_module.c =================================================================== --- src/http/ngx_http_header_filter_module.c (revision 4615) +++ src/http/ngx_http_header_filter_module.c (working copy) @@ -99,16 +99,24 @@ ngx_string("415 Unsupported Media Type"), ngx_string("416 Requested Range Not Satisfiable"), - /* ngx_null_string, */ /* "417 Expectation Failed" */ - /* ngx_null_string, */ /* "418 unused" */ - /* ngx_null_string, */ /* "419 unused" */ - /* ngx_null_string, */ /* "420 unused" */ - /* ngx_null_string, */ /* "421 unused" */ - /* ngx_null_string, */ /* "422 Unprocessable Entity" */ - /* ngx_null_string, */ /* "423 Locked" */ - /* ngx_null_string, */ /* "424 Failed Dependency" */ + ngx_null_string, /* "417 Expectation Failed" */ + ngx_null_string, /* "418 unused" */ + ngx_null_string, /* "419 unused" */ + ngx_null_string, /* "420 unused" */ + ngx_null_string, /* "421 unused" */ + ngx_null_string, /* "422 Unprocessable Entity" */ + ngx_null_string, /* "423 Locked" */ + ngx_null_string, /* "424 Failed Dependency" */ + ngx_null_string, /* "425 unused" */ + ngx_null_string, /* "426 unused" */ + ngx_null_string, /* "427 unused" */ + ngx_null_string, /* "428 Precondition Required" */ -#define NGX_HTTP_LAST_4XX 417 + ngx_string("429 Too Many Requests"), + ngx_null_string, /* "430 unused" */ + ngx_string("431 Request Header Fields Too Large"), + +#define NGX_HTTP_LAST_4XX 432 #define NGX_HTTP_OFF_5XX (NGX_HTTP_LAST_4XX - 400 + NGX_HTTP_OFF_4XX) ngx_string("500 Internal Server Error"), @@ -120,12 +128,14 @@ ngx_null_string, /* "505 HTTP Version Not Supported" */ ngx_null_string, /* "506 Variant Also Negotiates" */ ngx_string("507 Insufficient Storage"), - /* ngx_null_string, */ /* "508 unused" */ - /* ngx_null_string, */ /* "509 unused" */ - /* ngx_null_string, */ /* "510 Not Extended" */ + ngx_null_string, /* "508 unused" */ + ngx_null_string, /* "509 unused" */ + ngx_null_string, /* "510 Not Extended" */ -#define NGX_HTTP_LAST_5XX 508 + ngx_string("511 Network Authentication Required"), +#define NGX_HTTP_LAST_5XX 512 + };