From 22b0ed049622aad934d8cdb8ae9bbb507744d317 Mon Sep 17 00:00:00 2001 From: ben Date: Thu, 29 Sep 2022 10:31:10 +0100 Subject: [PATCH] Added Caddy --- docs/guide/installation.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/docs/guide/installation.md b/docs/guide/installation.md index 2b058754d..e77e301d2 100644 --- a/docs/guide/installation.md +++ b/docs/guide/installation.md @@ -292,6 +292,41 @@ Save the file and run the following commands: sudo systemctl enable lnbits.service sudo systemctl start lnbits.service ``` +## Running using Caddy reverse proxy with automatic https + +Point your domain at the IP of the server you're running LNbits on, by making an `A` record. + +Install Caddy on the server +https://caddyserver.com/docs/install#debian-ubuntu-raspbian + +``` +sudo caddy stop +``` +Create a Caddyfile +``` +sudo nano Caddyfile +``` +Assuming your LNbits is running on port `5000`: +``` +yourdomain.com { + handle /api/v1/payments/sse* { + reverse_proxy 0.0.0.0:5000 { + header_up X-Forwarded-Host legend.lnbits.com + transport http { + keepalive off + compression off + } + } + } + reverse_proxy 0.0.0.0:5000 { + header_up X-Forwarded-Host legend.lnbits.com + } +} +``` +Save and exit `CTRL + x` +``` +sudo caddy start +``` ## Running behind an apache2 reverse proxy over https Install apache2 and enable apache2 mods