Updated Apache config to be a little more flexible.

This commit is contained in:
Nick Daly committed 2013-10-06 21:00:06 -05:00
1 parent 721fca19fc
commit 4f2cb54f32
2 files changed
+43 -438

No files matched your search

+43 -29
View File
@@ -1,39 +1,53 @@
<VirtualHost *:80>
# The DocumentRoot is set by fabric
DocumentRoot /dev/null
ServerName plinth
ServerAlias plinth.*
## Force ssl
RewriteEngine on
ReWriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
## Use this rule to hang plinth off of plinth.(servername)
## The DocumentRoot is set by fabric
DocumentRoot /dev/null
ServerName plinth
ServerAlias plinth.*
## Force SSL
RewriteEngine on
ReWriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
</VirtualHost>
<VirtualHost *:443>
# The DocumentRoot is set by fabric
DocumentRoot /dev/null
ServerName plinth
ServerAlias plinth.*
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.pem
## Enable SSL
SSLEngine on
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
## Use a rule like this to hang plinth off a subdir
#RewriteEngine on
#RewriteRule ^/plinth/(.*)$ http://localhost:8000/$1 [P,L]
#Use the following to debug rewrite rules
#RewriteLog "/var/log/apache2/rewrite.log"
#RewriteLogLevel 9
## Use this rule to hang plinth off of plinth.(servername)
## The DocumentRoot is set by fabric
DocumentRoot /dev/null
ServerName plinth
ServerAlias plinth.*
ProxyPreserveHost on
ProxyPass /static !
ProxyPass / http://localhost:8000/
ProxyPassReverse / http://localhost:8000/
<Proxy *>
Order Deny,Allow
Deny from All
Allow from 10.0.0.0/8
Allow from 172.16.0.0/12
Allow from 192.168.0.0/16
</Proxy>
## Use this rule to hang plinth off a subdir.
## Make sure to provide plinth with a default directory: /plinth
# <Location /plinth>
# ProxyPass http://localhost:8000/plinth
# ProxyPassReverse http://localhost:8000/plinth
#
# Order Deny,Allow
# Deny from All
# Allow from 10.0.0.0/8
# Allow from 172.16.0.0/12
# Allow from 192.168.0.0/16
# </Location>
## Use proxy directives to hand plinth off a domain or subdomain
ProxyPass /static !
ProxyPass / http://localhost:8000/
ProxyPassReverse / http://localhost:8000/
<Proxy *>
allow from all
</Proxy>
</VirtualHost>