Proxy Dashing Dashboard behind Apache with SSL

I needed to allow access to my Dashing dashboard over ssl from the Internet.  I decided to proxy it behind Apache and get Apache to do all the SSL heavy lifting, mainly because I couldn’t work out if and how you could enable SSL within Dashing itself.
It turned out to be quite simple to implement. I simply created a vhost configuration for my dashboard and enabled it in Apache.
Create a file  called dashboard in /etc/apache2/sites-available/ with the following content:

<VirtualHost *:80>
 ServerName dashboard.example.com
 Redirect permanent / https://dashboard.example.com/
</VirtualHost>
NameVirtualHost *:443
<VirtualHost _default_:443>
 SSLEngine On
 SSLCertificateFile /etc/ssl/CAcert.cert.pem
 SSLCertificateKeyFile /etc/ssl/private/key.pem
 ServerAdmin webmaster@localhost
 ServerName dashboard.example.com
 ErrorLog "/var/log/apache2/dashboard-error_log"
 CustomLog "/var/log/apache2/dashboard-access_log" common
 <Proxy *>
   Order allow,deny
   Allow from all
 </Proxy>
 ProxyPass / http://mylocalserver.example.com:3030/
 ProxyPassReverse / http://mylocalserver.example.com:3030/
</VirtualHost>

Ensure the proxy modules are enabled:

$ sudo a2enmod proxy
Enabling module proxy.
To activate the new configuration, you need to run:
service apache2 restart
$ sudo a2enmod proxy_http
Enabling module proxy_http.
To activate the new configuration, you need to run:
service apache2 restart
$

Enable the new dashboard site:

$ sudo a2ensite dashboard

Check your configuration is working before restarting apache:

$ sudo apachectl configtest
Syntax OK
$ sudo service apache2 restart
[ ok ] Restarting web server: apache2 ... waiting .
$

Don’t forget to delegate your dashboard.example.com hostname to resolve to your apache server’s IP address.
Now visit http://dashboard.example.com/name_of_your_dashboard. Your browser should automatically get redirected to https://dashboard.example.com/name_of_your_dashboard and you should see your dashboard.


Comments

One response to “Proxy Dashing Dashboard behind Apache with SSL”

  1. That was incredibly easy, thanks for writing and sharing this.

Leave a Reply

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