Skip to content

Instantly share code, notes, and snippets.

@clemlatz
Last active December 23, 2022 10:43
Show Gist options
  • Save clemlatz/35cf6765f935e7930807 to your computer and use it in GitHub Desktop.
Save clemlatz/35cf6765f935e7930807 to your computer and use it in GitHub Desktop.
Set up ssl proxy with nginx and letsencrypt (https://secure.example.com => http://example.com)
# Update & upgrade
sudo apt-get update
sudo apt-get upgrade
# Install & start nginx
sudo apt-get install nginx -y
sudo service nginx start
# Install git
sudo apt-get install git -y
# Install letsencrypt
git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
# Install letsencrypt dependencies
./letsencrypt-auto --help all
# Stop nginx (port 80 needed by letsencrypt)
sudo nginx service stop
# Generate certificate
./letsencrypt-auto certonly --rsa-key-size 4096
# Generate a strong Diffie-Hellman (2048-bit) group
sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment