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

25 lines
700 B
Bash
Raw Normal View History

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