Project

General

Profile

« Previous | Next » 

Revision 6667cd71

Added by Jim Pingle over 1 year ago

Catch/handle some HTTP errors. Implements #15322

  • Catch 50x errors, even from PHP FPM, so users don't end up with a
    blank white screen if an error happens too early in processing.
  • Catch 404 errros.
  • Handle both with static pages since PHP-FPM may have an issue of its
    own, so don't loop back there.

View differences:

src/etc/inc/system.inc
1863 1863
	if ($captive_portal !== false) {
1864 1864
		$nginx_config .= "\tlimit_conn_zone \$binary_remote_addr zone=addr:10m;\n";
1865 1865
		$nginx_config .= "\tkeepalive_timeout 0;\n";
1866
		$intercept_errors = "";
1866 1867
	} else {
1867 1868
		$nginx_config .= "\tkeepalive_timeout 75;\n";
1869
		$nginx_config .= "\terror_page 404 /404.html;\n";
1870
		$nginx_config .= "\terror_page 500 502 503 504 /50x.html;\n";
1871
		$intercept_errors = "\t\t\tfastcgi_intercept_errors on;\n";
1868 1872
	}
1869 1873
	$nginx_config .= "\tclient_header_timeout 10;\n";
1870 1874

  
......
1960 1964
			# Fix httpoxy - https://httpoxy.org/#fix-now
1961 1965
			fastcgi_param  HTTP_PROXY  "";
1962 1966
			fastcgi_read_timeout 180;
1967
{$intercept_errors}
1963 1968
			include        /usr/local/etc/nginx/fastcgi_params;
1964 1969
		}
1965 1970
		location ~ (^/status$) {

Also available in: Unified diff