diff modules/website/files/php.conf @ 365:f22809cba7af

Make sure missing HTML and PHP files get error handled Without this we just get "file not found" from php-fpm. We could override the proxy response with Apache, but that would break NextCloud login, which gives 4xx pages with login forms etc that we don't want replaced with generic pages.
author IBBoard <dev@ibboard.co.uk>
date Sat, 07 Nov 2020 14:33:17 +0000
parents 5be4616ffca0
children f354100b688a
line wrap: on
line diff
--- a/modules/website/files/php.conf	Sun Nov 01 17:04:44 2020 +0000
+++ b/modules/website/files/php.conf	Sat Nov 07 14:33:17 2020 +0000
@@ -8,5 +8,8 @@
 </Proxy>
 <FilesMatch "\.php$">
 	# Don't wrap in an <IfModule> because we'd rather it failed
+	RewriteCond %{REQUEST_FILENAME} !-f
+	RewriteRule . /error.php [L]
+
 	SetHandler "proxy:unix:/run/php-fpm/www.sock|fcgi://localhost/"
 </FilesMatch>