diff -Nur nginx-1.1.11.orig/src/http/modules/ngx_http_fastcgi_module.c nginx-1.1.11/src/http/modules/ngx_http_fastcgi_module.c
|
old
|
new
|
|
| 287 | 287 | offsetof(ngx_http_fastcgi_loc_conf_t, upstream.pass_request_body), |
| 288 | 288 | NULL }, |
| 289 | 289 | |
| | 290 | // twu2 begin |
| | 291 | // option to skip 404 error |
| | 292 | { ngx_string("fastcgi_intercept_error_skip_404"), |
| | 293 | NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
| | 294 | ngx_conf_set_flag_slot, |
| | 295 | NGX_HTTP_LOC_CONF_OFFSET, |
| | 296 | offsetof(ngx_http_fastcgi_loc_conf_t, upstream.intercept_error_skip_404), |
| | 297 | NULL }, |
| | 298 | // twu2 edn |
| | 299 | |
| 290 | 300 | { ngx_string("fastcgi_intercept_errors"), |
| 291 | 301 | NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
| 292 | 302 | ngx_conf_set_flag_slot, |
| … |
… |
|
| 2092 | 2102 | conf->upstream.pass_headers = NGX_CONF_UNSET_PTR; |
| 2093 | 2103 | |
| 2094 | 2104 | conf->upstream.intercept_errors = NGX_CONF_UNSET; |
| | 2105 | // twu2 begin |
| | 2106 | // option to skip 404 error |
| | 2107 | conf->upstream.intercept_error_skip_404 = NGX_CONF_UNSET; |
| | 2108 | // twu2 end |
| 2095 | 2109 | |
| 2096 | 2110 | /* "fastcgi_cyclic_temp_file" is disabled */ |
| 2097 | 2111 | conf->upstream.cyclic_temp_file = 0; |
| … |
… |
|
| 2332 | 2346 | |
| 2333 | 2347 | ngx_conf_merge_value(conf->upstream.intercept_errors, |
| 2334 | 2348 | prev->upstream.intercept_errors, 0); |
| | 2349 | // twu2 begin |
| | 2350 | // option to skip 404 error |
| | 2351 | ngx_conf_merge_value(conf->upstream.intercept_errors, |
| | 2352 | prev->upstream.intercept_errors, 0); |
| | 2353 | // twu2 end |
| 2335 | 2354 | |
| 2336 | 2355 | ngx_conf_merge_ptr_value(conf->catch_stderr, prev->catch_stderr, NULL); |
| 2337 | 2356 | |
diff -Nur nginx-1.1.11.orig/src/http/ngx_http_upstream.c nginx-1.1.11/src/http/ngx_http_upstream.c
|
old
|
new
|
|
| 1742 | 1742 | return NGX_DECLINED; |
| 1743 | 1743 | } |
| 1744 | 1744 | |
| | 1745 | // twu2 begin |
| | 1746 | // don't intercept 404 error (it will be processed by upstream) |
| | 1747 | if (status == NGX_HTTP_NOT_FOUND && u->conf->intercept_error_skip_404) |
| | 1748 | return NGX_DECLINED; |
| | 1749 | // twu2 end |
| | 1750 | |
| 1745 | 1751 | clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); |
| 1746 | 1752 | |
| 1747 | 1753 | if (clcf->error_pages == NULL) { |
diff -Nur nginx-1.1.11.orig/src/http/ngx_http_upstream.h nginx-1.1.11/src/http/ngx_http_upstream.h
|
old
|
new
|
|
| 148 | 148 | |
| 149 | 149 | ngx_flag_t ignore_client_abort; |
| 150 | 150 | ngx_flag_t intercept_errors; |
| | 151 | // twu2 begin |
| | 152 | // add an option to skip intercept 404 error |
| | 153 | ngx_flag_t intercept_error_skip_404; |
| | 154 | // twu2 end |
| 151 | 155 | ngx_flag_t cyclic_temp_file; |
| 152 | 156 | |
| 153 | 157 | ngx_path_t *temp_path; |