Skip to content

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

Merged
quietsy merged 1 commit into
masterfrom
replace-http_host
Oct 20, 2026
Merged

quietsy merged 1 commit into
masterfrom
replace-http_host

Conversation

@nemchik

@nemchik nemchik commented Jul 18, 2026 •

Copy link
Copy Markdown
Member

Requires: #622

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. (rebase has replaced commits)

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.

NOTE: $host$is_request_port$request_port should only be used when constructing a URI. It should NOT be used when setting Host, X-Forwarded-Host, X-Forwarded-Server, etc because they are not constructing a URI. Comments have been added accordingly to proxy.conf.sample

I do not run proxy auth currently, so I have not tested these changes with proxy auth (comments from users below confirm it is working as intended).

@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
@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.

@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
@LinuxServer-CI

Copy link
Copy Markdown
Contributor

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

ghcr.io/linuxserver/lspipepr-swag:5.7.0-pkg-2c427b14-dev-6aa9d294d77b516cbb56947294d93cb57cd045d9-pr-620

@nemchik
nemchik marked this pull request as ready for review August 16, 2026 15:09
@LinuxServer-CI

Copy link
Copy Markdown
Contributor

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

ghcr.io/linuxserver/lspipepr-swag:5.7.0-pkg-3f36cd44-dev-0150bc76d377aaa8c238eebce3577cde68c47d2c-pr-620

@LinuxServer-CI

Copy link
Copy Markdown
Contributor

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

ghcr.io/linuxserver/lspipepr-swag:5.7.0-pkg-145be6ff-dev-aa0d432ef2701db0d9369cb84eb37fc02b186774-pr-620

@LinuxServer-CI

Copy link
Copy Markdown
Contributor

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

ghcr.io/linuxserver/lspipepr-swag:5.7.0-pkg-d759f532-dev-6df6b809d679e0bb3d8278c45cd498bc269a5bbc-pr-620

@LinuxServer-CI

Copy link
Copy Markdown
Contributor

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

ghcr.io/linuxserver/lspipepr-swag:5.7.0-pkg-d759f532-dev-41730c3d83bcd384e1f3d6e878b403b361d05d8a-pr-620

@LinuxServer-CI

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

@steveiliop56

Copy link
Copy Markdown
Contributor

@nemchik this looks good to me. Any chance you could rebase to master so the linuxserver team can have a look?

@james-d-elliott james-d-elliott left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, formally endorsing this change.

…t_port$request_port for better compatibility

Signed-off-by: GitHub <noreply@github.com>
@LinuxServer-CI

Copy link
Copy Markdown
Contributor

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

ghcr.io/linuxserver/lspipepr-swag:5.8.0-pkg-7f841ac2-dev-aeb73706752fd83a1b724f77eaad5eda6fc5514c-pr-620

@steveiliop56 steveiliop56 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM as well

@LinuxServer-CI LinuxServer-CI moved this from PRs Ready For Team Review to PRs Approved in Issue & PR Tracker Oct 20, 2026

@quietsy quietsy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@quietsy
quietsy merged commit f503b59 into master Oct 20, 2026
5 checks passed
@quietsy
quietsy deleted the replace-http_host branch October 20, 2026 14:25
@LinuxServer-CI LinuxServer-CI moved this from PRs Approved to Done in Issue & PR Tracker Oct 20, 2026
@nemchik nemchik mentioned this pull request Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

6 participants