Skip to content

Instantly share code, notes, and snippets.

@jvalleroy
Created October 31, 2013 01:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jvalleroy/7243082 to your computer and use it in GitHub Desktop.
Save jvalleroy/7243082 to your computer and use it in GitHub Desktop.
Get Plinth HTTPS to function correctly with jwchat site enabled.
diff --git a/apache2/sites-available/jwchat.conf b/apache2/sites-available/jwchat.conf
index d67df9c..4fb38d2 100644
--- a/apache2/sites-available/jwchat.conf
+++ b/apache2/sites-available/jwchat.conf
@@ -10,5 +10,11 @@
<Proxy *>
Allow from all
</Proxy>
+
+ ## Force SSL for Plinth
+ RewriteEngine on
+ ReWriteCond %{REQUEST_URI} ^/plinth
+ ReWriteCond %{SERVER_PORT} !^443$
+ RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment