NginxProxyManager / NginxProxyManager/nginx-proxy-manager

WebDAV MOVE Fails: NPM Auto-Added Host Header Overrides Custom Config

Open
#4,799 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

When configuring a Custom Location / with custom proxy_set_header directives, NPM automatically adds proxy_set_header Host $host; which overrides the intended custom setting. This causes issues with services that require the full Host: hostname:port format (e.g., WebDAV services).

Specifically, when adding proxy_set_header Host $http_host; in Custom Location config, NPM still injects proxy_set_header Host $host; after it, making the custom setting ineffective.

To Reproduce

  1. Create a proxy host pointing to a backend service
  2. Add a Custom Location with path /
  3. In the custom Nginx configuration, add: proxy_set_header Host $http_host;
  4. Save and reload
  5. Check the generated Nginx config file - proxy_set_header Host $host; still exists and overrides the custom setting

Expected behavior

Either:

  • The custom proxy_set_header Host directive should not be overridden by auto-generated defaults
  • NPM should detect duplicate directives and use the custom one instead
  • NPM should provide an option to disable auto-injection of certain headers

Operating System

Docker (jc21/nginx-proxy-manager:latest)

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 inspecting the generated Nginx configuration for a Custom Location and trace where the automatic proxy_set_header Host $host; directive is added. Reproduce the configuration with proxy_set_header Host $http_host;, then verify that the custom directive is no longer overridden and the configuration still reloads successfully.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.