AllowOverride None
Require all granted
Options All MultiViews
AllowOverride All
Require all granted
ServerName "~~domain~~"
~~alias_block~~
DocumentRoot "/mnt/users/~~user~~/~~domain~~/public_html"
RewriteEngine on
RewriteCond %{SERVER_NAME} =~~domain~~
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
ServerName "~~domain~~"
~~alias_block~~
DocumentRoot "/mnt/users/~~user~~/~~domain~~/public_html"
SSLCertificateFile /etc/pki/tls/certs/localhost.crt
SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
SetHandler "proxy:fcgi://~~fpm_host~~:~~fpm_port~~"
# Rewrite SCRIPT_FILENAME for PHP-FPM: the shared httpd serves from
# /mnt/users/{user}/{domain}/public_html but the FPM container has
# files at /home/{user}/public_html. Use regex match with backreferences
# to reconstruct the correct path for the FPM container.
ProxyFCGISetEnvIf "reqenv('SCRIPT_FILENAME') =~ m#^/mnt/users/([^/]+)/([^/]+)/public_html(.*)#" SCRIPT_FILENAME "/home/$1/public_html$3"
DirectoryIndex index.php index.html index.htm
ErrorLog "/var/log/httpd/~~domain~~-error.log"
CustomLog "/var/log/httpd/~~domain~~-access.log" combined