Nginx

You could use any webserver for this step, as all we’re going to be doing is proxying requests from port 80 to our application port, which defaults to 8080 for bottle.

If you’re using Debian or Debian variant such as Ubuntu and you’ve installed Nginx using apt, then you’ll have a funky config file layout like apache. All we’re going to do is add a config file for a virtualhost. Because I’m using Ubuntu, I’m going to make that file in /etc/nginx/sites-available. You’ll probably have to sudo this because you might not shouldn’t have permission to write into the /etc/ directory. You should call your file something nice and semantic such as ‘mydomain.com’

$ sudo touch /etc/nginx/sites-available/mydomain.com

Now it’s just a case of supplying the correct config information for our virtual host and restarting Nginx.

The above code is telling nginx x that for all requests for jmcrl.com to forward them to http://127.0.0.1:8080- which is where we’ve configured supervisord to run our bottle app.

Debian / Unbuntu Jiggery Pokery

As I mentioned above on Debian & Debian variants the layout for nginx config is like that of Apache, with one difference - there’s no command (a2ensite) for enabling and deactivating your available sites.

Fear not, all the command done (or appeared to do that I noticed) was create or remove symlinks between sites-available and site-enabled. So if your using Debian or a Debian variant then you’ll have to do the following step to get Nginx to pick up your config file.