comparison src/http/ngx_http_special_response.c @ 196:8759b346e431 NGINX_0_3_45

nginx 0.3.45 *) Feature: the "ssl_verify_client", "ssl_verify_depth", and "ssl_client_certificate" directives. *) Change: the $request_method variable now returns the main request method. *) Change: the ° symbol codes were changed in koi-win conversion table. *) Feature: the euro и N symbols were added to koi-win conversion table. *) Bugfix: if nginx distributed the requests among several backends and some backend failed, then requests intended for this backend was directed to one live backend only instead of being distributed among the rest.
author Igor Sysoev <http://sysoev.ru>
date Sat, 06 May 2006 00:00:00 +0400
parents 54aabf2b0bc6
children dd6c66b5b0e2
comparison
equal deleted inserted replaced
195:b65e20aebc10 196:8759b346e431
158 static char error_416_page[] = 158 static char error_416_page[] =
159 "<html>" CRLF 159 "<html>" CRLF
160 "<head><title>416 Requested Range Not Satisfiable</title></head>" CRLF 160 "<head><title>416 Requested Range Not Satisfiable</title></head>" CRLF
161 "<body bgcolor=\"white\">" CRLF 161 "<body bgcolor=\"white\">" CRLF
162 "<center><h1>416 Requested Range Not Satisfiable</h1></center>" CRLF 162 "<center><h1>416 Requested Range Not Satisfiable</h1></center>" CRLF
163 ;
164
165
166 static char error_495_page[] =
167 "<html>" CRLF
168 "<head><title>400 The SSL certificate error</title></head>"
169 CRLF
170 "<body bgcolor=\"white\">" CRLF
171 "<center><h1>400 Bad Request</h1></center>" CRLF
172 "<center>The SSL certificate error</center>" CRLF
173 ;
174
175
176 static char error_496_page[] =
177 "<html>" CRLF
178 "<head><title>400 No required SSL certificate was sent</title></head>"
179 CRLF
180 "<body bgcolor=\"white\">" CRLF
181 "<center><h1>400 Bad Request</h1></center>" CRLF
182 "<center>No required SSL certificate was sent</center>" CRLF
163 ; 183 ;
164 184
165 185
166 static char error_497_page[] = 186 static char error_497_page[] =
167 "<html>" CRLF 187 "<html>" CRLF
252 ngx_string(error_415_page), 272 ngx_string(error_415_page),
253 ngx_string(error_416_page), 273 ngx_string(error_416_page),
254 274
255 #define NGX_HTTP_LEVEL_400 17 275 #define NGX_HTTP_LEVEL_400 17
256 276
277 ngx_string(error_495_page), /* 495, https certificate error */
278 ngx_string(error_496_page), /* 496, https no certificate */
257 ngx_string(error_497_page), /* 497, http to https */ 279 ngx_string(error_497_page), /* 497, http to https */
258 ngx_string(error_404_page), /* 498, invalid host name */ 280 ngx_string(error_404_page), /* 498, invalid host name */
259 ngx_null_string, /* 499, client had closed connection */ 281 ngx_null_string, /* 499, client had closed connection */
260 282
261 ngx_string(error_500_page), 283 ngx_string(error_500_page),
294 switch (error) { 316 switch (error) {
295 case NGX_HTTP_BAD_REQUEST: 317 case NGX_HTTP_BAD_REQUEST:
296 case NGX_HTTP_REQUEST_ENTITY_TOO_LARGE: 318 case NGX_HTTP_REQUEST_ENTITY_TOO_LARGE:
297 case NGX_HTTP_REQUEST_URI_TOO_LARGE: 319 case NGX_HTTP_REQUEST_URI_TOO_LARGE:
298 case NGX_HTTP_TO_HTTPS: 320 case NGX_HTTP_TO_HTTPS:
321 case NGX_HTTPS_CERT_ERROR:
322 case NGX_HTTPS_NO_CERT:
299 case NGX_HTTP_INTERNAL_SERVER_ERROR: 323 case NGX_HTTP_INTERNAL_SERVER_ERROR:
300 r->keepalive = 0; 324 r->keepalive = 0;
301 } 325 }
302 } 326 }
303 327
304 if (r->lingering_close == 1) { 328 if (r->lingering_close == 1) {
305 switch (error) { 329 switch (error) {
306 case NGX_HTTP_BAD_REQUEST: 330 case NGX_HTTP_BAD_REQUEST:
307 case NGX_HTTP_TO_HTTPS: 331 case NGX_HTTP_TO_HTTPS:
332 case NGX_HTTPS_CERT_ERROR:
333 case NGX_HTTPS_NO_CERT:
308 r->lingering_close = 0; 334 r->lingering_close = 0;
309 } 335 }
310 } 336 }
311 337
312 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); 338 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
370 err = error - NGX_HTTP_OWN_CODES + NGX_HTTP_LEVEL_200 396 err = error - NGX_HTTP_OWN_CODES + NGX_HTTP_LEVEL_200
371 + NGX_HTTP_LEVEL_300 397 + NGX_HTTP_LEVEL_300
372 + NGX_HTTP_LEVEL_400; 398 + NGX_HTTP_LEVEL_400;
373 switch (error) { 399 switch (error) {
374 case NGX_HTTP_TO_HTTPS: 400 case NGX_HTTP_TO_HTTPS:
401 case NGX_HTTPS_CERT_ERROR:
402 case NGX_HTTPS_NO_CERT:
375 r->headers_out.status = NGX_HTTP_BAD_REQUEST; 403 r->headers_out.status = NGX_HTTP_BAD_REQUEST;
376 error = NGX_HTTP_BAD_REQUEST; 404 error = NGX_HTTP_BAD_REQUEST;
377 break; 405 break;
378 } 406 }
379 } 407 }