Skip to content

Fix: Add IPv6 listen directives to nginx template - #482

Open
yaoge123 wants to merge 1 commit into
haiwen:masterfrom
yaoge123:fix-ipv6-listen
Open

Fix: Add IPv6 listen directives to nginx template#482
yaoge123 wants to merge 1 commit into
haiwen:masterfrom
yaoge123:fix-ipv6-listen

Conversation

@yaoge123

@yaoge123 yaoge123 commented Feb 28, 2026

Copy link
Copy Markdown

Problem

The nginx configuration template only listens on IPv4 addresses, which causes "Connection refused" errors when accessing the seafile container via IPv6 addresses in Docker networks.

Error observed:

connect() failed (111: Connection refused) while connecting to upstream, 
upstream: "http://[fd00:192:168:1::3]:80/..."

Root Cause

The template only includes listen 80; and listen 443 ssl; which only bind to IPv4 addresses. In Docker networks with IPv6 enabled, containers may be accessed via IPv6 addresses, causing connection failures.

Solution

Add IPv6 listen directives to all server blocks:

  • listen [::]:80; for HTTP
  • listen [::]:443 ssl; for HTTPS

Changes

  • Added listen [::]:80; to the HTTP redirect server block (for HTTPS mode)
  • Added listen [::]:443 ssl; to the HTTPS server block
  • Added listen [::]:80; to the HTTP server block (for non-HTTPS mode)

Testing

  • IPv6 connections now work correctly
  • IPv4 connections continue to work (backward compatible)
  • Both HTTP and HTTPS modes support IPv6

Fix connection refused errors when accessing seafile container
via IPv6 addresses in Docker networks.

- Add listen [::]:80 for HTTP
- Add listen [::]:443 ssl for HTTPS

Fixes: connection refused on fd00:192:168:200::3:80
Copilot AI review requested due to automatic review settings February 28, 2026 11:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Seafile nginx config template to also bind to IPv6 addresses, addressing connection failures when the container is reached via IPv6 within Docker networks.

Changes:

  • Add listen [::]:80; to the HTTP redirect server block (HTTPS mode).
  • Add listen [::]:443 ssl; to the HTTPS server block.
  • Add listen [::]:80; to the HTTP server block (non-HTTPS mode).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants