Changeset b6797e
- Timestamp:
- 02/04/09 21:15:09 (3 years ago)
- Branches:
- master-v0.7, upstream_count_limit
- Children:
- ad7c65, c522ec
- Parents:
- a81aea
- git-author:
- George Potapov <nephrite@…> (02/04/09 21:15:09)
- git-committer:
- George Potapov <nephrite@…> (02/04/09 21:15:09)
- Location:
- server/src/http
- Files:
-
- 4 edited
-
modules/ngx_http_fastcgi_module.c (modified) (1 diff)
-
modules/ngx_http_proxy_module.c (modified) (1 diff)
-
ngx_http_upstream.c (modified) (4 diffs)
-
ngx_http_upstream.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
server/src/http/modules/ngx_http_fastcgi_module.c
ra9b74b rb6797e 166 166 { ngx_string("http_503"), NGX_HTTP_UPSTREAM_FT_HTTP_503 }, 167 167 { ngx_string("http_504"), NGX_HTTP_UPSTREAM_FT_HTTP_504 }, 168 { ngx_string("http_507"), NGX_HTTP_UPSTREAM_FT_HTTP_507 },169 168 { ngx_string("http_404"), NGX_HTTP_UPSTREAM_FT_HTTP_404 }, 170 169 { ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF }, -
server/src/http/modules/ngx_http_proxy_module.c
r9941a7 rb6797e 152 152 { ngx_string("http_503"), NGX_HTTP_UPSTREAM_FT_HTTP_503 }, 153 153 { ngx_string("http_504"), NGX_HTTP_UPSTREAM_FT_HTTP_504 }, 154 { ngx_string("http_507"), NGX_HTTP_UPSTREAM_FT_HTTP_507 },155 154 { ngx_string("http_404"), NGX_HTTP_UPSTREAM_FT_HTTP_404 }, 156 155 { ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF }, -
server/src/http/ngx_http_upstream.c
ra9b74b rb6797e 1125 1125 ngx_http_upstream_header_t *hh; 1126 1126 ngx_http_upstream_main_conf_t *umcf; 1127 ngx_http_core_loc_conf_t *clcf;1128 ngx_http_err_page_t *err_page;1129 1127 1130 1128 c = u->peer.connection; … … 1257 1255 if (ngx_http_upstream_intercept_errors(r, u) == NGX_OK) { 1258 1256 return; 1259 }1260 }1261 1262 if (u->headers_in.status_n == NGX_HTTP_BAD_GATEWAY) {1263 1264 if (u->peer.tries > 11265 && u->conf->next_upstream & NGX_HTTP_UPSTREAM_FT_HTTP_502)1266 {1267 ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_HTTP_502);1268 return;1269 }1270 }1271 1272 if (u->headers_in.status_n == NGX_HTTP_SERVICE_UNAVAILABLE) {1273 1274 if (u->peer.tries > 11275 && u->conf->next_upstream & NGX_HTTP_UPSTREAM_FT_HTTP_503)1276 {1277 ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_HTTP_503);1278 return;1279 }1280 }1281 1282 if (u->headers_in.status_n == NGX_HTTP_GATEWAY_TIME_OUT) {1283 1284 if (u->peer.tries > 11285 && u->conf->next_upstream & NGX_HTTP_UPSTREAM_FT_HTTP_504)1286 {1287 ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_HTTP_504);1288 return;1289 }1290 }1291 1292 if (u->headers_in.status_n == NGX_HTTP_INSUFFICIENT_STORAGE) {1293 1294 if (u->peer.tries > 11295 && u->conf->next_upstream & NGX_HTTP_UPSTREAM_FT_HTTP_507)1296 {1297 ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_HTTP_507);1298 return;1299 }1300 }1301 1302 if (u->headers_in.status_n >= NGX_HTTP_BAD_REQUEST1303 && u->conf->intercept_errors)1304 {1305 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);1306 1307 if (clcf->error_pages) {1308 1309 err_page = clcf->error_pages->elts;1310 for (i = 0; i < clcf->error_pages->nelts; i++) {1311 if (err_page[i].status == (ngx_int_t) u->headers_in.status_n) {1312 1313 if (u->headers_in.status_n == NGX_HTTP_UNAUTHORIZED) {1314 1315 r->headers_out.www_authenticate =1316 ngx_list_push(&r->headers_out.headers);1317 1318 if (r->headers_out.www_authenticate == NULL) {1319 ngx_http_upstream_finalize_request(r, u,1320 NGX_HTTP_INTERNAL_SERVER_ERROR);1321 return;1322 }1323 1324 *r->headers_out.www_authenticate =1325 *u->headers_in.www_authenticate;1326 }1327 1328 ngx_http_upstream_finalize_request(r, u,1329 u->headers_in.status_n);1330 return;1331 }1332 }1333 1257 } 1334 1258 } … … 2480 2404 switch(ft_type) { 2481 2405 2482 case NGX_HTTP_UPSTREAM_FT_HTTP_504:2483 2406 case NGX_HTTP_UPSTREAM_FT_TIMEOUT: 2484 2407 status = NGX_HTTP_GATEWAY_TIME_OUT; … … 2491 2414 case NGX_HTTP_UPSTREAM_FT_HTTP_404: 2492 2415 status = NGX_HTTP_NOT_FOUND; 2493 break;2494 2495 case NGX_HTTP_UPSTREAM_FT_HTTP_502:2496 status = NGX_HTTP_BAD_GATEWAY;2497 break;2498 2499 case NGX_HTTP_UPSTREAM_FT_HTTP_503:2500 status = NGX_HTTP_SERVICE_UNAVAILABLE;2501 break;2502 2503 case NGX_HTTP_UPSTREAM_FT_HTTP_507:2504 status = NGX_HTTP_INSUFFICIENT_STORAGE;2505 2416 break; 2506 2417 -
server/src/http/ngx_http_upstream.h
r9941a7 rb6797e 27 27 #define NGX_HTTP_UPSTREAM_FT_BUSY_LOCK 0x00000200 28 28 #define NGX_HTTP_UPSTREAM_FT_MAX_WAITING 0x00000400 29 #define NGX_HTTP_UPSTREAM_FT_HTTP_507 0x0000080030 29 #define NGX_HTTP_UPSTREAM_FT_NOLIVE 0x40000000 31 30 #define NGX_HTTP_UPSTREAM_FT_OFF 0x80000000
Note: See TracChangeset
for help on using the changeset viewer.
