Skip to content

Add IPv6 listen directives to nginx vhost templates on Linux - #20

Merged
peterjaap merged 1 commit into
mainfrom
fix-ipv6
Mar 14, 2026
Merged

peterjaap merged 1 commit into
mainfrom
fix-ipv6

Conversation

@peterjaap

Copy link
Copy Markdown
Collaborator

On Linux, *.localhost domains resolve to ::1 (IPv6) before 127.0.0.1. Without IPv6 listen directives, requests hit the wrong server block, causing confusing errors from other projects.

Adds listen [::]:port directives to all nginx templates (Magento, Laravel, proxy) conditionally on Linux.

macOS is unaffected as it uses port forwarding.

On Linux, *.localhost domains resolve to ::1 (IPv6) before 127.0.0.1.
Without IPv6 listen directives, requests hit the wrong server block,
causing confusing errors from other projects.

Adds listen [::]:port directives to all nginx templates (Magento,
Laravel, proxy) conditionally on Linux. macOS is unaffected as it
uses port forwarding.
@peterjaap
peterjaap merged commit c1f038f into main Mar 14, 2026
10 checks passed
@peterjaap
peterjaap deleted the fix-ipv6 branch March 14, 2026 22:00
Aquive added a commit to Aquive/magebox that referenced this pull request Mar 30, 2026
macOS resolves .test domains to both ::1 (IPv6) and 127.0.0.1 (IPv4),
and clients try IPv6 first. The pf redirect rules only handled IPv4,
causing connection refused errors. This adds inet6 pf rules and enables
IPv6 listen directives in nginx on macOS.

Also fixes the upgrade path to always rewrite pf rules on bootstrap,
preventing stale rules when the anchor file changes between versions.

Related: qoliber#20

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Aquive added a commit to Aquive/magebox that referenced this pull request Mar 30, 2026
macOS resolves .test domains to both ::1 (IPv6) and 127.0.0.1 (IPv4),
and clients try IPv6 first. The pf redirect rules only handled IPv4,
causing connection refused errors. This adds inet6 pf rules and enables
IPv6 listen directives in nginx on macOS.

Also fixes the upgrade path to always rewrite pf rules on bootstrap,
preventing stale rules when the anchor file changes between versions.

Related: qoliber#20

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
peterjaap pushed a commit that referenced this pull request Mar 31, 2026
macOS resolves .test domains to both ::1 (IPv6) and 127.0.0.1 (IPv4),
and clients try IPv6 first. The pf redirect rules only handled IPv4,
causing connection refused errors. This adds inet6 pf rules and enables
IPv6 listen directives in nginx on macOS.

Also fixes the upgrade path to always rewrite pf rules on bootstrap,
preventing stale rules when the anchor file changes between versions.

Related: #20

Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
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.

1 participant