How to set up HTTPS.
This commit is contained in:
parent
823e0a405a
commit
b752ea4cd4
1 changed files with 34 additions and 0 deletions
34
nginx/ssl_setup.md
Normal file
34
nginx/ssl_setup.md
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
# SSL or HTTPS
|
||||||
|
|
||||||
|
The other day I successfully set up SSL for the LNBits reverse proxy. Here is
|
||||||
|
what I did:
|
||||||
|
|
||||||
|
- Downloaded the keys for my domain certificates from porkbun.
|
||||||
|
- Made the certs available inside the nginx container.
|
||||||
|
- Added the following stuff in the config file for nginx.
|
||||||
|
|
||||||
|
```
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name lnbits.contrapeso.xyz;
|
||||||
|
return 301 https://$host$request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 443 ssl;
|
||||||
|
server_name lnbits.contrapeso.xyz;
|
||||||
|
ssl_certificate /certs/domain.cert.pem;
|
||||||
|
ssl_certificate_key /certs/private.key.pem;
|
||||||
|
ssl_trusted_certificate /certs/intermediate.cert.pem;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://100.93.54.53:3007;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_redirect off;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- Profit! http gets forbidden with the first block, and https works with the
|
||||||
|
second bit.
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue