FreedomBox/share/apache2/plinth.conf
Nick Daly d84150b103 Fix DocumentRoot: Apache can serve Plinth's static files.
Without this change, Apache tries to serve the static files from
/dev/null/static, which never exists, so users will see all exciting
manner of errors.

I've assumed that the correct directory is the default directory that
Freedom-Maker installs Plinth to, currently ``/home/fbx/plinth``.
Other distributions will need to patch this out to their preferred
location, like ``/usr/share/plinth/static``.
2013-10-18 16:59:35 -05:00

54 lines
1.5 KiB
Plaintext

<VirtualHost *:80>
## 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>
## Enable SSL
SSLEngine on
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
## Use this rule to hang plinth off of plinth.(servername)
## The DocumentRoot is set by fabric
DocumentRoot /home/fbx/plinth/static
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>
</VirtualHost>