Skip to content

Update Nginx configuration to replace $http_host with $host$is_request_port$request_port for better compatibility#620

Draft
nemchik wants to merge 3 commits into
masterfrom
replace-http_host
Draft

Update Nginx configuration to replace $http_host with $host$is_request_port$request_port for better compatibility#620
nemchik wants to merge 3 commits into
masterfrom
replace-http_host

Conversation

@nemchik

@nemchik nemchik commented Jul 18, 2026

Copy link
Copy Markdown
Member

Needs alpine 3.24 rebase for nginx 1.29.3 or higher (alpine 3.24 has nginx 1.30.3)

First commit switched from $http_host to $host:$server_port but this breaks when standard ports (80/443) are used.

From FonduemangVI on Discord

empty: HTTP/3. QUIC/h3 requests carry :authority instead of a Host header, and nginx's $http_host (raw header) can come back empty on h3 connections — known nginx QUIC behaviour. $host is the safe variable (falls back to :authority/server_name).

This misses the need for handling non-standard ports (ex: 8443) for the users that do that.

nginx has some variables to solve it though:

$host$is_request_port$request_port is the current recommended solution.

I do not run proxy auth currently, so I have not tested those changes.

…ort for better compatibility

Signed-off-by: Eric Nemchik <eric@nemchik.com>
@nemchik
nemchik requested a review from a team July 18, 2026 17:29
@LinuxServer-CI LinuxServer-CI moved this from PRs to PRs Ready For Team Review in Issue & PR Tracker Jul 18, 2026
Signed-off-by: Eric Nemchik <eric@nemchik.com>
@LinuxServer-CI

Copy link
Copy Markdown
Contributor

I am a bot, here is the pushed image/manifest for this PR for commit a393925 :

ghcr.io/linuxserver/lspipepr-swag:5.7.0-pkg-140fa390-dev-a393925f4495479e40f6e1a18cde0ff9455b9133-pr-620

@LinuxServer-CI

Copy link
Copy Markdown
Contributor

I am a bot, here is the pushed image/manifest for this PR for commit 69afc4d :

ghcr.io/linuxserver/lspipepr-swag:5.7.0-pkg-140fa390-dev-69afc4de5860151d25d568c515367bd916ba07f0-pr-620

@nemchik
nemchik requested a review from Copilot July 18, 2026 18:15

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

…for improved compatibility

Signed-off-by: Eric Nemchik <eric@nemchik.com>
@nemchik nemchik changed the title Update Nginx configuration to replace $http_host with $host:$server_port for better compatibility Update Nginx configuration to replace $http_host with $host$is_request_port$request_port for better compatibility Jul 18, 2026
@LinuxServer-CI

Copy link
Copy Markdown
Contributor

I am a bot, here is the pushed image/manifest for this PR for commit a2509cc :

ghcr.io/linuxserver/lspipepr-swag:5.7.0-pkg-140fa390-dev-a2509cc44ea3cbbaf010771adf900fdd5c9b1504-pr-620

@nemchik
nemchik marked this pull request as draft July 18, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: PRs Ready For Team Review

Development

Successfully merging this pull request may close these issues.

3 participants