summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorJames Vasile <james@hackervisions.org>2011-12-20 20:50:58 -0500
committerJames Vasile <james@jamesvasile.com>2012-02-19 15:07:15 -0500
commit77647e907dc8855e85c80449292ca08b7ff5b25a (patch)
treea68640484e44c7cf839547e293448089dc4e4ce4 /share
parent5ed705e87535d0603ae0b13388f2c231ab29a127 (diff)
subdomain for plinth
Diffstat (limited to 'share')
-rw-r--r--share/apache2/plinth.conf40
1 files changed, 32 insertions, 8 deletions
diff --git a/share/apache2/plinth.conf b/share/apache2/plinth.conf
index 7046b10..6f0612f 100644
--- a/share/apache2/plinth.conf
+++ b/share/apache2/plinth.conf
@@ -1,11 +1,35 @@
-ProxyPass /plinth/ http://localhost:8000/
-<Directory />
-Options Indexes FollowSymLinks
+<VirtualHost *:80>
+ DocumentRoot /dev/null
+ ServerName plinth
-RewriteEngine on
-RewriteRule [^/]*/plinth$ plinth/ [R]
-RewriteRule [^/]*/$ plinth/ [R]
-#RewriteRule ^$ plinth/ [R]
+ ## Force ssl
+ RewriteEngine on
+ ReWriteCond %{SERVER_PORT} !^443$
+ RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
+
+</VirtualHost>
+
+<VirtualHost *:443>
+ DocumentRoot /home/james/src/plinth/static
+ ServerName plinth
+
+ SSLEngine on
+ SSLCertificateFile /etc/apache2/ssl/apache.pem
+
+ ## 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 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>
-</Directory>