[PR #3828] [MERGED] recommend using $http_host for ngnix #4097

Closed
opened 2026-04-25 00:18:18 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3828
Author: @mikiher
Created: 1/12/2025
Status: Merged
Merged: 1/12/2025
Merged by: @advplyr

Base: masterHead: nginx-host-fix


📝 Commits (1)

  • 1812282 recommend using $http_host for ngnix

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 readme.md (+2 -2)

📄 Description

Brief summary

Changes our recommendation for Nginx reverse proxy setup to set the Host header to $http_host instead of $host

Which issue is fixed?

This helped in fixing #3809, which turned out to be caused by Ngnix misconfiguration.

In-depth Description

In Ngnix, $host and $http_host are usually the same, except when Nginx is configured to a non-standard HTTP port (i.e. not 80 or 443). When Nginx uses a non-standard HTTP port, $host is just the hostname without the port, while $http_host is the actual
Host header from the original request, which has both hostname and port.

Since ABS now uses the host to construct RSS feed entries dynamically, it's important to get the actual host from the original request, so that feed links are properly constructed.

How have you tested this?

Changing the config solved the issue for #3809 reporter.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/3828 **Author:** [@mikiher](https://github.com/mikiher) **Created:** 1/12/2025 **Status:** ✅ Merged **Merged:** 1/12/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `nginx-host-fix` --- ### 📝 Commits (1) - [`1812282`](https://github.com/advplyr/audiobookshelf/commit/181228294600bc50e8f824d9329838d90f1171df) recommend using $http_host for ngnix ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `readme.md` (+2 -2) </details> ### 📄 Description ## Brief summary Changes our recommendation for Nginx reverse proxy setup to set the `Host` header to `$http_host` instead of `$host` ## Which issue is fixed? This helped in fixing #3809, which turned out to be caused by Ngnix misconfiguration. ## In-depth Description In Ngnix, `$host` and `$http_host` are usually the same, except when Nginx is configured to a non-standard HTTP port (i.e. not 80 or 443). When Nginx uses a non-standard HTTP port, `$host` is just the hostname without the port, while `$http_host` is the actual `Host` header from the original request, which has both hostname and port. Since ABS now uses the host to construct RSS feed entries dynamically, it's important to get the actual host from the original request, so that feed links are properly constructed. ## How have you tested this? Changing the config solved the issue for #3809 reporter. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:18:18 +02:00
adam closed this issue 2026-04-25 00:18:18 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4097