Skip to content

Commit

Permalink
Fix IPv6 in selfhost-nginx
Browse files Browse the repository at this point in the history
Previously `nginx` was only listening on IPv4 addresses which was
breaking certbot on IPv6-configured servers. This commit fixes it by
setting `nginx` to also listen on IPv6 in addition to IPv4.
  • Loading branch information
Kixunil committed Aug 1, 2023
1 parent 56b3b63 commit ed3f52a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg_specs/selfhost.changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
selfhost (0.1.9-1) buster; urgency=medium

* Fixed IPv6

-- Martin Habovstiak <[email protected]> Tue, 1 Aug 2022 15:01:10 +0100

selfhost (0.1.8-1) buster; urgency=low

* Added X-Forwarded-Host
Expand Down
2 changes: 2 additions & 0 deletions selfhost/nginx/config_top_template.mustache
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
server {
{{#tls_key}}
listen {{#public}}[::]{{/public}}{{^public}}[::1]{{/public}}:443 ssl http2;
listen {{#public}}0.0.0.0{{/public}}{{^public}}127.0.0.1{{/public}}:443 ssl http2;
ssl_certificate {{{tls_cert}}};
ssl_certificate_key {{{tls_key}}};
Expand Down Expand Up @@ -32,6 +33,7 @@ server {
{{#tls_key}}
{{#public}}
server {
listen [::]:80;
listen 0.0.0.0:80;
server_name {{{domain}}};
return 301 https://$host$request_uri;
Expand Down

0 comments on commit ed3f52a

Please sign in to comment.