docker-images/pluie/alpine-apache-fpm/pre-init.d/10-vhost.sh

28 lines
790 B
Bash
Raw Normal View History

2016-08-12 02:06:57 +00:00
#!/usr/bin/bash
# @app pluie/alpine-apache
# @author a-Sansara https://git.pluie.org/pluie/docker-images
if [ ! -z "/app/vhost" ]; then
cat <<EOF > "/app/vhost"
<VirtualHost *:80>
ServerName $HTTP_SERVER_NAME
2017-03-15 03:35:10 +00:00
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=\$1
2016-08-12 02:06:57 +00:00
<FilesMatch \.php$>
SetHandler proxy:fcgi://127.0.0.1:9000
</FilesMatch>
<Directory /app/$WWW_DIR>
AllowOverride None
Require all granted
DirectoryIndex $WWW_INDEX
<IfModule mod_rewrite.c>
Options -MultiViews +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ $WWW_INDEX [QSA,L]
</IfModule>
</Directory>
</VirtualHost>
# IncludeOptional /app/vhost2
EOF
fi