Skip to content

Instantly share code, notes, and snippets.

@jlstanus
Last active December 11, 2019 11:43
Show Gist options
  • Save jlstanus/6ff32d8a3dfaf8b38ac3a321e9d61479 to your computer and use it in GitHub Desktop.
Save jlstanus/6ff32d8a3dfaf8b38ac3a321e9d61479 to your computer and use it in GitHub Desktop.
Setup a proxy with let's encrypt. Source: https://github.com/oSoc19/best/blob/master/pelias/README.md

Proxy Server

Why?

FR

Set up a proxy

In this step we will setup an apache proxy server: Our server is an ubuntu server (18.04.2).

Install and setup apache

We can install the apache server with the following commands:

sudo apt update
sudo apt install apache2

Now we have to set it up by editing the 000-default.conf. You can use vim or any other text-editor:

vim /etc/apache2/sites-available/000-default.conf

Edit the file to have these lines:

<VirtualHost *:80>
        ServerName <yourdomain.example.com>
        ServerAdmin webmaster@localhost
        ProxyPass "/" "http://localhost:4000/"
        ProxyPassReverse "/" "http://localhost:4000"
</VirtualHost>

Enable the proxy and proxy_http modules with this command:

a2enmod proxy proxy_http

Restart the apache server:

systemctl restart apache2

Enable HTTPS

We use certbot to set up HTTPS. The easiest and most up-to-date instructions can be found on https://certbot.eff.org/instructions. Setting this up should take about 5 minutes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment