# HG changeset patch # User IBBoard # Date 1604759597 0 # Node ID f22809cba7afd1cb42aaee91dc497c0669fa69ea # Parent 8224f42ee05bea23ac160a104ac3bd1a124853e8 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. diff -r 8224f42ee05b -r f22809cba7af modules/website/files/conf.extra/html-php.conf --- a/modules/website/files/conf.extra/html-php.conf Sun Nov 01 17:04:44 2020 +0000 +++ b/modules/website/files/conf.extra/html-php.conf Sat Nov 07 14:33:17 2020 +0000 @@ -10,5 +10,8 @@ #If we're doing HTML files as PHP then swap the priority for directory indexing DirectoryIndex /index.html /index.php + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule . /error.php [L] + SetHandler "proxy:unix:/run/php-fpm/www.sock|fcgi://localhost/" diff -r 8224f42ee05b -r f22809cba7af modules/website/files/php.conf --- 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 @@ # Don't wrap in an because we'd rather it failed + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule . /error.php [L] + SetHandler "proxy:unix:/run/php-fpm/www.sock|fcgi://localhost/"