Nginx not listen on IPv6 if not use HTTPS

I set up a test server in an internal network (cannot be reached from outside, so cannot set up let’s encrypt), and I found that the nginx does not listen on IPv6 when the server has an IPv6 address. The /etc/nginx/conf.d/discourse.conf inside container shows listen 80; but no listen [::]:80;.

I have another production server which can be reached on IPv6 normally. And I have searched meta to find what is wrong with my test server configuration. Finally, I find that only if I add web.letsencrypt.ssl.template.yml and web.ssl.template.yml to my app.yml can I use IPv6 normally. The reason is that these files add listen [::]:80;. and listen [::]:443 ssl http2; in nginx configuration file.

The team can add IPv6 support to non-HTTPS install, i.e., add listen [::]:80; to web.template.yml.

Discourse mostly doesn’t work without https. They may not add the feature you request. But your can look at the ssl template to see what gets included to turn on ipv6 and add that code to your own template or the app.yml.

1 Like

Yes, I tried to add to app.yml like this and it works.

    - replace:
        filename: "/etc/nginx/conf.d/discourse.conf"
        from: /listen.+$/
        to: |
          listen 80;
          listen [::]:80;

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.