Mercurial > hg > nginx
comparison src/http/ngx_http_special_response.c @ 6965:3ef4cadfad7f
Added support for "429 Too Many Requests" response (RFC6585).
This change adds reason phrase in status line and pretty response body
when "429" status code is used in "return", "limit_conn_status" and/or
"limit_req_status" directives.
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
author | Piotr Sikora <piotrsikora@google.com> |
---|---|
date | Fri, 24 Mar 2017 02:48:03 -0700 |
parents | 25203fc377fb |
children | be5cfa918bfc |
comparison
equal
deleted
inserted
replaced
6964:5d3d9b52327d | 6965:3ef4cadfad7f |
---|---|
220 static char ngx_http_error_421_page[] = | 220 static char ngx_http_error_421_page[] = |
221 "<html>" CRLF | 221 "<html>" CRLF |
222 "<head><title>421 Misdirected Request</title></head>" CRLF | 222 "<head><title>421 Misdirected Request</title></head>" CRLF |
223 "<body bgcolor=\"white\">" CRLF | 223 "<body bgcolor=\"white\">" CRLF |
224 "<center><h1>421 Misdirected Request</h1></center>" CRLF | 224 "<center><h1>421 Misdirected Request</h1></center>" CRLF |
225 ; | |
226 | |
227 | |
228 static char ngx_http_error_429_page[] = | |
229 "<html>" CRLF | |
230 "<head><title>429 Too Many Requests</title></head>" CRLF | |
231 "<body bgcolor=\"white\">" CRLF | |
232 "<center><h1>429 Too Many Requests</h1></center>" CRLF | |
225 ; | 233 ; |
226 | 234 |
227 | 235 |
228 static char ngx_http_error_494_page[] = | 236 static char ngx_http_error_494_page[] = |
229 "<html>" CRLF | 237 "<html>" CRLF |
352 ngx_null_string, /* 417 */ | 360 ngx_null_string, /* 417 */ |
353 ngx_null_string, /* 418 */ | 361 ngx_null_string, /* 418 */ |
354 ngx_null_string, /* 419 */ | 362 ngx_null_string, /* 419 */ |
355 ngx_null_string, /* 420 */ | 363 ngx_null_string, /* 420 */ |
356 ngx_string(ngx_http_error_421_page), | 364 ngx_string(ngx_http_error_421_page), |
357 | 365 ngx_null_string, /* 422 */ |
358 #define NGX_HTTP_LAST_4XX 422 | 366 ngx_null_string, /* 423 */ |
367 ngx_null_string, /* 424 */ | |
368 ngx_null_string, /* 425 */ | |
369 ngx_null_string, /* 426 */ | |
370 ngx_null_string, /* 427 */ | |
371 ngx_null_string, /* 428 */ | |
372 ngx_string(ngx_http_error_429_page), | |
373 | |
374 #define NGX_HTTP_LAST_4XX 430 | |
359 #define NGX_HTTP_OFF_5XX (NGX_HTTP_LAST_4XX - 400 + NGX_HTTP_OFF_4XX) | 375 #define NGX_HTTP_OFF_5XX (NGX_HTTP_LAST_4XX - 400 + NGX_HTTP_OFF_4XX) |
360 | 376 |
361 ngx_string(ngx_http_error_494_page), /* 494, request header too large */ | 377 ngx_string(ngx_http_error_494_page), /* 494, request header too large */ |
362 ngx_string(ngx_http_error_495_page), /* 495, https certificate error */ | 378 ngx_string(ngx_http_error_495_page), /* 495, https certificate error */ |
363 ngx_string(ngx_http_error_496_page), /* 496, https no certificate */ | 379 ngx_string(ngx_http_error_496_page), /* 496, https no certificate */ |