Skip to content

Instantly share code, notes, and snippets.

@m-o-e
Created March 26, 2022 08:40
Show Gist options
  • Save m-o-e/b6bcd0e0290a1acb30264fe8d69bca08 to your computer and use it in GitHub Desktop.
Save m-o-e/b6bcd0e0290a1acb30264fe8d69bca08 to your computer and use it in GitHub Desktop.
HTTPS Reverse Proxy - The easy way

HTTPS Reverse Proxy - The easy way

  1. Install Caddy (as per https://caddyserver.com/docs/install):

    sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
    curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo tee /etc/apt/trusted.gpg.d/caddy-stable.asc
    curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
    sudo apt update
    sudo apt install caddy
  2. Put this into your /etc/Caddyfile:

    my.example.com
    reverse_proxy localhost:8080
    
  3. Restart Caddy:

    sudo systemctl restart caddy

That's all.

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