Add template to enable an IPv6 listener
authorMichael Brown <supermathie@gmail.com>
Tue, 4 Apr 2023 17:36:41 +0000 (13:36 -0400)
committerMichael Brown <supermathie@gmail.com>
Tue, 4 Apr 2023 17:36:41 +0000 (13:36 -0400)
By default nginx in the container only listens for IPv4 connections. Some users
want to enable direct IPv6 connectivity to the container either via forwarding
or NAT. This provides an easy method to allow that.

samples/standalone.yml
samples/web_only.yml
templates/web.ipv6.template.yml [new file with mode: 0644]

index 80adeafc38fe55142e31a6b23dc2e533419d1214..2ba6d15e6321105330708bd087cac3dbdf3ef486 100644 (file)
@@ -11,8 +11,10 @@ templates:
   - "templates/postgres.template.yml"
   - "templates/redis.template.yml"
   - "templates/web.template.yml"
+  ## Uncomment the next line to enable the IPv6 listener
+  #- "templates/web.ipv6.template.yml"
   - "templates/web.ratelimited.template.yml"
-## Uncomment these two lines if you wish to add Lets Encrypt (https)
+  ## Uncomment these two lines if you wish to add Lets Encrypt (https)
   #- "templates/web.ssl.template.yml"
   #- "templates/web.letsencrypt.ssl.template.yml"
 
index 08e41712fc2f8b0884ec3de98a529c3027f2a34f..ea830937d8b428f4f54a91b997999e0e3726473a 100644 (file)
@@ -3,8 +3,10 @@
 
 templates:
   - "templates/web.template.yml"
+  ## Uncomment the next line to enable the IPv6 listener
+  #- "templates/web.ipv6.template.yml"
   - "templates/web.ratelimited.template.yml"
-## Uncomment these two lines if you wish to add Lets Encrypt (https)
+  ## Uncomment these two lines if you wish to add Lets Encrypt (https)
   #- "templates/web.ssl.template.yml"
   #- "templates/web.letsencrypt.ssl.template.yml"
 
diff --git a/templates/web.ipv6.template.yml b/templates/web.ipv6.template.yml
new file mode 100644 (file)
index 0000000..bf589fe
--- /dev/null
@@ -0,0 +1,8 @@
+run:
+  - exec: echo "Enabling IPv6 listener"
+  - replace:
+      filename: "/etc/nginx/conf.d/discourse.conf"
+      from: listen 80;
+      to: |
+        listen 80;
+        listen [::]:80;