Opened 12 years ago

Closed 12 years ago

#71 closed enhancement (wontfix)

skip 404 process for fastcgi_intercept_errors

Reported by: www.google.com/accounts/o8/id?id=AItOawnA1VZSCGBObt9MGuZNyHKljvkW-zBDNko Owned by: somebody
Priority: minor Milestone:
Component: nginx-module Version: 1.1.x
Keywords: fastcgi_intercept_errors Cc:
uname -a: Linux www 3.1.1 #2 SMP Sat Nov 19 14:07:56 CST 2011 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.1.11
built by gcc 4.4.5 (Debian 4.4.5-8)
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-log-path=/var/log/nginx/access.log --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --with-debug --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_realip_module --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-http_xslt_module --with-ipv6 --with-sha1=/usr/include/openssl --with-md5=/usr/include/openssl --with-mail --with-mail_ssl_module --add-module=/usr/src/debian/nginx/nginx-1.1.11/debian/modules/nginx-echo --add-module=/usr/src/debian/nginx/nginx-1.1.11/debian/modules/nginx-upstream-fair

Description

when fastcgi_intercept_errors off (default):

  1. php program have error (but display_errors off in php), it got http 500 status, and display a blank page.
  2. php program offer it's own 404 error page (http status 404), it work fine.

when fastcgi_intercept_errors on:

  1. php program have error (but display_errors off in php), it got http 500 status, redirect to error_page for error 500 (not blank page).
  2. php program offer it's own 404 error page (http status 404), it will also redirect to error_page for 404, (not the one generated by upstream program).

we want nginx don't redirect 404 for such case the program already offer it's 404 page, just redirect other error.

this patch will add a new option fastcgi_intercept_error_skip_404 to skip the 404 status for fastcgi_intercept_errors on.

Attachments (1)

nginx-intercept_error_skip_404.patch (3.0 KB ) - added by www.google.com/accounts/o8/id?id=AItOawnA1VZSCGBObt9MGuZNyHKljvkW-zBDNko 12 years ago.

Download all attachments as: .zip

Change History (2)

by www.google.com/accounts/o8/id?id=AItOawnA1VZSCGBObt9MGuZNyHKljvkW-zBDNko, 12 years ago

comment:1 by Maxim Dounin, 12 years ago

Resolution: wontfix
Status: newclosed

The *_intercept_errors is expected to handle everything which has corresponding error_page defined. If you don't want to intercept something - don't define error_page for the error code in question.

BTW, it's not really a good idea to submit patches via trac. Use nginx-devel@ mailing list instead.

Note: See TracTickets for help on using tickets.