Last active
March 13, 2022 22:59
-
-
Save tmulzer/e8c407f88bd8a31ed5be653cd4313893 to your computer and use it in GitHub Desktop.
nginx-config für reverse-proxy mit http innen, https außen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ufw disable | |
certbot --expand -n --nginx --domains <dns_a_name>,<dns_cname_1>,<dns_cname_2>,[...] | |
ufw enable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[...] | |
server{ | |
listen 80; | |
# listen [::]:80; // if IPv6 enabled. | |
server_name <external_dns_cname>; | |
return 301 https://$host$request_uri; | |
} | |
// [...] | |
server { | |
listen 443 ssl; | |
# listen [::]:443 ssl; // if IPv6 enabled. | |
server_name <external_dns_cname>; | |
location / { | |
proxy_pass http://<internal_ip_[:<port>]>/; | |
} | |
ssl_certificate /etc/letsencrypt/live/<dns_name_of_hostsystem_with_certbot>/fullchain.pem; # managed by Certbot | |
ssl_certificate_key /etc/letsencrypt/live/<dns_name_of_hostsystem_with_certbot>/privkey.pem; # managed by Certbot | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment