NginxProxyManager / NginxProxyManager/nginx-proxy-manager

proxy_set_header Host $http_host setting does not take effect

Open
#4,011 6 comments 10 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug stale
Dominant language
TypeScript
Stars
34.2k
Forks
3.9k
Avg merge
21h 12m
Merged PRs (30d)
20

Description

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes
  • Are you sure you're not using someone else's docker image?
    • Yes
  • Have you searched for similar issues (both open and closed)?
    • Yes

Describe the bug

Nginx Proxy Manager Version

2.11.3

To Reproduce
Steps to reproduce the behavior:
After proxy_set_header Host $http_host is set, it will be placed at the front of "location", resulting in the configuration not being effective. For details, please see the figure
My configuration on the page is as follows:
image
The configuration information seen in conf is as follows:
image
As shown in the figure, since proxy_set_header Host $host; is generated by default and is after proxy_set_header Host $http_host;, proxy_set_header Host $host; will take effect.

Expected behavior

Custom configuration should be placed at the end, not at the beginning, to ensure that the custom configuration can take effect normally, as shown in the following figure
image

Operating System

Additional context

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the nginx-proxy-manager:latest Docker image and inspect the generated nginx configuration for the order of proxy_set_header directives. Trace where the default Host header and custom configuration are assembled; done means custom directives appear after the defaults and the generated configuration uses the custom Host value.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, nginx
Domain
backend, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.