Skip to content

fix(docker): explicitly enable IPv6 in nginx config (#264)#332

Open
LeC-D wants to merge 1 commit intoiib0011:mainfrom
LeC-D:fix/docker-ipv6-support
Open

fix(docker): explicitly enable IPv6 in nginx config (#264)#332
LeC-D wants to merge 1 commit intoiib0011:mainfrom
LeC-D:fix/docker-ipv6-support

Conversation

@LeC-D
Copy link
Copy Markdown

@LeC-D LeC-D commented Mar 15, 2026

Summary

Fixes #264

Problem

The nginx:alpine image ships with a startup script (10-listen-on-ipv6-by-default.sh) that automatically adds listen [::]:80; to /etc/nginx/conf.d/default.confbut only if the file hasn't been modified. Since the Dockerfile already patches default.conf via sed (to add try_files), the script detects the change and skips IPv6 configuration. As a result, the container only listens on IPv4.

Fix

Add an explicit listen [::]:80; directive via a separate RUN sed command, mirroring exactly what the entrypoint script would have done.

+ RUN sed -i 's|listen       80;|listen       80;\n    listen  [::]:80;|' /etc/nginx/conf.d/default.conf

Testing

Verified the resulting default.conf contains both listen 80; and listen [::]:80; after the build stage. No functional changes to routing or static file serving.

@LeC-D LeC-D force-pushed the fix/docker-ipv6-support branch from a30d70e to c0f227b Compare March 25, 2026 00:06
@LeC-D
Copy link
Copy Markdown
Author

LeC-D commented Mar 25, 2026

Rebased on upstream main (2026-03-24) to bring the branch up to date.

@LeC-D
Copy link
Copy Markdown
Author

LeC-D commented Mar 26, 2026

Rebased on upstream main (2026-03-26) to bring the branch back up to date.

@Chesterkxng
Copy link
Copy Markdown
Collaborator

Hello, thanks! I’ll let @iib0011 check this out, as I’m not very familiar with DevOps.

@LeC-D LeC-D force-pushed the fix/docker-ipv6-support branch from c0f227b to 6a6c728 Compare March 27, 2026 08:26
@LeC-D
Copy link
Copy Markdown
Author

LeC-D commented Mar 28, 2026

Rebased on upstream main (2026-03-28) to bring the branch back up to date.

The nginx:alpine entrypoint script (10-listen-on-ipv6-by-default.sh)
skips IPv6 configuration when it detects that default.conf has been
modified. Since we already patch default.conf via sed, IPv6 was never
enabled in the Docker container.

Fix: add a listen [::]:80 directive explicitly via an additional sed
command, mirroring what the entrypoint script would have done.
@LeC-D LeC-D force-pushed the fix/docker-ipv6-support branch from 6a6c728 to 3c4c0e1 Compare March 29, 2026 22:04
@LeC-D
Copy link
Copy Markdown
Author

LeC-D commented Mar 29, 2026

Rebased on upstream main (2026-03-29) to bring the branch back up to date.

@LeC-D
Copy link
Copy Markdown
Author

LeC-D commented Apr 1, 2026

Rebased on upstream main (2026-04-01) to bring the branch back up to date.

@LeC-D
Copy link
Copy Markdown
Author

LeC-D commented Apr 3, 2026

Rebased on upstream main (2026-04-03) to bring the branch back up to date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docker container - listen on IPv6

2 participants