Is het mogelijk om te installeren met IPv6 uitgeschakeld?

AI-generated summary

In a discussion titled ‘Is it possible to install with IPv6 disabled? (Spoiler: I don’t think so)’, pfaffman reports attempting to disable IPv6 in Discourse by modifying nginx config files to remove or alter [::]:80 listeners, but still encounters errors like socket() [::]:80 failed (97: Address family not supported by protocol). They reference an old post by Falco indicating nginx fails to boot when IPv6 is disabled at the kernel level. featheredtoast confirms it’s unlikely to work, noting IPv6 is deeply integrated into Discourse’s package, making clean removal difficult and unsupported. pfaffman thanks them, relieved no simple fix was overlooked. The motivation stems from a VM provider disabling IPv6, which took months to resolve. The consensus is that running Discourse without IPv6 is currently not feasible due to hard-coded dependencies in nginx and other components.

I see in the web template where it checks to see if /proc/net/if_inet6 exists and turns off the listen for [::]:80, but there’s still one in the default nginx file.

I added these to try to fix that:

  - exec: sed -i '/listen \[::\]:80 default_server;/d' /etc/nginx/sites-available/default
  - exec: sed -i 's/listen 80 default_server;/listen 0.0.0.0:80 default_server ipv6only=off;/' /etc/nginx/sites-available/default
  - exec: sed -i 's/listen 80 default_server;/listen 0.0.0.0:80 default_server ipv6only=off;/' /etc/nginx/conf.d/discourse.conf

But I still see this in the logs:

2025/09/02 21:34:29 [emerg] 359#359: socket() [::]:80 failed (97: Address family not supported by protocol)
2025/09/02 21:34:34 [notice] 3240#3240: signal process started
2025/09/02 21:34:34 [error] 3240#3240: open() "/run/nginx.pid" failed (2: No such file or directory)

A long time ago, it seemed impossible:

Has anyone actually made Discourse work with IPv6 disabled at the kernel level?

(Why? Because the VM someone supplied has IPv6 turned off. It took months for them to provision a VM that they would let me access.)

Ongetwijfeld. Ik heb onlangs ook een soortgelijke regel in het ssl-bestand verwijderd met wat hulp van @schleifer - ik was nog niet aan de web-template toegekomen.

IPv6-ondersteuning is behoorlijk ingebakken in ons pakket, dus het is vrij moeilijk om het overal netjes te verwijderen en er verificatie/ondersteuning voor te bieden.

Hartelijk dank voor de snelle bevestiging! Ik was er vrij zeker van dat dit het geval was en ben opgelucht dat ik geen voor de hand liggende eenvoudige oplossing had over het hoofd gezien.