Mocha behind a reverse proxy
Sometimes, individuals & organisations like to put applications behind a reverse proxy, the main reason for this is to allow applications to be accessed on specific domains. An example of this would be a helpdesk company running Mocha having it accessible to employees through their domain name.Setting up the box & nginx
In this example, I’m going to be using a node provided by linode pre-installed with docker, but any vm should be able to achieve this provided they have a static i.p address. I wont be going into any detail regarding secuirty or best practices for setting up a linux machine, or we’ll be here all day :) This is going to be a straight forward, down to business guide. With docker pre installed, we need to get the second piece of the puzzle installed, which is nginx. Since this our first interaction which the machine, we’ll need to update the package manager to get the latest listings:- Nginx Full: This profile opens both port 80 (normal, unencrypted web traffic) and port 443 (TLS/SSL encrypted traffic)
- Nginx HTTP: This profile opens only port 80 (normal, unencrypted web traffic)
- Nginx HTTPS: This profile opens only port 443 (TLS/SSL encrypted traffic)
Checking nginx
To make sure nginx is running okay when can run the command:Setting up Mocha
Now nginx is out the way and configured, we can now simply download the docker compose file from github:ctrl + x and then y to save. When this is complete run the command: