mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-04-29 10:10:19 +00:00
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
54 lines
2.1 KiB
Plaintext
54 lines
2.1 KiB
Plaintext
# Proxy all PHP file requests through PHP-FPM.
|
|
#
|
|
# Based on /etc/apache2/conf-available/php7.3-fpm.conf but modified to not break
|
|
# when PHP version upgrade happens due to php-fpm package depending on the
|
|
# latest version of PHP. Since PHP-FPM unix sockets have version number their
|
|
# path, to work with future version of PHP, hack assuming some future versions.
|
|
|
|
# Redirect to local php-fpm if mod_php is not available
|
|
<IfModule !mod_php7.c>
|
|
<IfModule proxy_fcgi_module>
|
|
# Enable http authorization headers
|
|
<IfModule setenvif_module>
|
|
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
|
|
</IfModule>
|
|
|
|
<FilesMatch ".+\.ph(ar|p|tml)$">
|
|
<IfFile /etc/php/7.3>
|
|
SetHandler "proxy:unix:/run/php/php7.3-fpm.sock|fcgi://localhost"
|
|
</IfFile>
|
|
<IfFile /etc/php/7.4>
|
|
SetHandler "proxy:unix:/run/php/php7.4-fpm.sock|fcgi://localhost"
|
|
</IfFile>
|
|
<IfFile /etc/php/7.5>
|
|
SetHandler "proxy:unix:/run/php/php7.5-fpm.sock|fcgi://localhost"
|
|
</IfFile>
|
|
<IfFile /etc/php/7.6>
|
|
SetHandler "proxy:unix:/run/php/php7.6-fpm.sock|fcgi://localhost"
|
|
</IfFile>
|
|
<IfFile /etc/php/8.0>
|
|
SetHandler "proxy:unix:/run/php/php8.0-fpm.sock|fcgi://localhost"
|
|
</IfFile>
|
|
<IfFile /etc/php/8.1>
|
|
SetHandler "proxy:unix:/run/php/php8.1-fpm.sock|fcgi://localhost"
|
|
</IfFile>
|
|
<IfFile /etc/php/8.2>
|
|
SetHandler "proxy:unix:/run/php/php8.2-fpm.sock|fcgi://localhost"
|
|
</IfFile>
|
|
<IfFile /etc/php/8.3>
|
|
SetHandler "proxy:unix:/run/php/php8.3-fpm.sock|fcgi://localhost"
|
|
</IfFile>
|
|
</FilesMatch>
|
|
<FilesMatch ".+\.phps$">
|
|
# Deny access to raw php sources by default
|
|
# To re-enable it's recommended to enable access to the files
|
|
# only in specific virtual host or directory
|
|
Require all denied
|
|
</FilesMatch>
|
|
# Deny access to files without filename (e.g. '.php')
|
|
<FilesMatch "^\.ph(ar|p|ps|tml)$">
|
|
Require all denied
|
|
</FilesMatch>
|
|
</IfModule>
|
|
</IfModule>
|