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.