Skip to content

docs(admin): add nginx tips for Unix socket proxy and HTTP/3 host detection#14991

Merged
skjnldsv merged 1 commit into
masterfrom
fix/nginx-unix-socket-and-http3-tips
May 22, 2026
Merged

docs(admin): add nginx tips for Unix socket proxy and HTTP/3 host detection#14991
skjnldsv merged 1 commit into
masterfrom
fix/nginx-unix-socket-and-http3-tips

Conversation

@skjnldsv
Copy link
Copy Markdown
Member

☑️ Resolves

What and why

Two new entries added to the nginx "Tips and tricks" section:

1. Unix domain socket trusted proxy (#12908)

When an upstream proxy (Caddy, HAProxy, another nginx) passes requests to
Nextcloud's nginx via a Unix domain socket, REMOTE_ADDR is set to the
literal string unix: which Nextcloud cannot parse as a trusted proxy IP.
This causes a crash (Unsupported operand types: bool & string in IpAddress.php).

Fix: set_real_ip_from unix:; + real_ip_header X-Forwarded-For; in the
server block listening on the socket. Confirmed working by multiple users.

2. HTTP/3 "access through untrusted domain" (#12196)

Under HTTP/3 (QUIC), nginx may not forward HTTP_HOST to PHP-FPM, causing
Nextcloud to show the untrusted domain error even for correctly configured
trusted_domains.

Fix: explicitly add fastcgi_param HTTP_HOST $host; alongside the other
fastcgi_param directives.

🖼️ Screenshots

No visual/layout changes — prose and code block additions only.

✅ Checklist

  • I have built the documentation locally and reviewed the output
  • Screenshots are included for visual changes
  • I have not moved or renamed pages (or added a redirect if I did)
  • I have run codespell or similar and addressed any spelling issues

…ection

Two new entries in the nginx Tips and tricks section:

1. Unix domain socket trusted proxy: when an upstream proxy (Caddy,
   HAProxy, another nginx) passes requests via a Unix socket, nginx sets
   REMOTE_ADDR to the literal string "unix:" which Nextcloud cannot parse
   as a trusted proxy IP. Document the set_real_ip_from unix: fix.

2. HTTP/3 untrusted domain error: nginx may not forward HTTP_HOST to
   PHP-FPM under HTTP/3 (QUIC), causing Nextcloud to reject the request.
   Document the fastcgi_param HTTP_HOST $host; fix.

Fixes #12908
Relates to #12196

Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv
Copy link
Copy Markdown
Member Author

@skjnldsv skjnldsv requested a review from miaulalala May 21, 2026 09:40
@skjnldsv skjnldsv self-assigned this May 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

📖 Documentation Preview

🔍 Open preview →

📄 1 changed documentation page

Last updated: Thu, 21 May 2026 11:07:42 GMT

Copy link
Copy Markdown
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

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

seems to be good

@skjnldsv skjnldsv merged commit 02516f2 into master May 22, 2026
28 checks passed
@skjnldsv skjnldsv deleted the fix/nginx-unix-socket-and-http3-tips branch May 22, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"unix:" remote_addr is being parsed as an IP

2 participants