discourse – htpasswd protected

discour-apache-htpasswd

I have client who *needs* discourse under a subdomain that should be only accessed by users who have a valid username & password in a .htpasswd….
Since discourse doesn’t use Apache I had to implement Apache ProxyPass  to solve this ‘issue’…

This is how it looks…

<VirtualHost *:80>

 ServerName social.subdomain.com

 ProxyPreserveHost Off
 ProxyPass / http://192.241.XXX.XX/
 ErrorLog /data/logs/discourse_error.log

 <Location />
   AuthType Basic
   AuthName "Only for members"
   AuthBasicProvider file
   AuthUserFile "/path/to/.htpasswd"
   Require valid-user
 </Location>

</VirtualHost>

This might not be the best solution….. comments are appreciated! 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.