File: //etc/httpd/vhost.d/10-vhostd.conf
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
LoadModule filter_module modules/mod_filter.so
<VirtualHost *:80>
UseCanonicalName Off
<IfModule mod_remoteip.c>
RemoteIPInternalProxy 10.0.0.0/8
RemoteIPHeader X-Forwarded-For
</IfModule>
DocumentRoot /
<Directory /var/www/html>
Options ExecCGI Indexes Includes MultiViews FollowSymLinks
AllowOverride All
AddHandler cgi-script .cgi .pl .pm .py
IndexIgnore *
</Directory>
ServerAdmin webmaster@localhost
LogLevel warn
Include /var/local/httpd/09-errorlog.conf
Include /etc/httpd/vhost.d/fpm.d/*.conf
# Set header X-App-Status
<IfModule mod_headers.c>
Header always set X-App-Status "1"
</IfModule>
# Rewriting
RewriteEngine on
#Prevent htaccess rewrites for absolute path
RewriteCond %{REQUEST_URI} !^/var/www/html
RewriteCond %{HTTP:X-Realhost} ^(.+)$
# allow CGIs to work
RewriteCond %{HTTP:X-Realhost} !^/cgi-bin/
# Do the Magic
RewriteRule ^/(.*)$ /var/www/html/%0/web/$1
## and now deal with CGIs - we have to force a MIME type
RewriteCond %{HTTP:X-Realhost} ^/cgi-bin/
RewriteRule ^/(.*)$ /var/www/html/%0/web/cgi-bin/$1 [T=application/x-httpd-cgi]
## Fix DOCROOT_BUG - part 1, prepending
php_value auto_prepend_file /var/local/php/fix_docroot.php
</VirtualHost>