Skip to content

Having issues migrating functional nginx config into Nginx Proxy Manager #3131

Closed as not planned
@miversen33

Description

@miversen33

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

I have the following location defined in an nginx.conf which functions exactly as expected

location /portainer/ {
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-Ip $remote_addr;
    proxy_set_header X-Forwarded-For $remote_add_x_forwarded_for;
    proxy_pass https://hostname.domain:9443/;
}

I figured it would be as easy as adding a new proxy host in Nginx Proxy Manager, adding the /portainer/ location and setting the various proxy_header variables in the advanced section of the location. However, when I add literally any of the proxy_set_header lines above, the location throws a 400. I cannot see anything really "useful" in the container logs for nginx-proxy-manager.

Am I missing something?

Nginx Proxy Manager Version

v2.10.4

To Reproduce
Steps to reproduce the behavior:

  1. Create new proxy host
  2. Add a location
  3. Add proxy_set_header X-Real-IP $remote_addr; (for example) to the advanced section of the location
  4. Save the location
  5. Navigate a new tab to the location
  6. Observe 400

Expected behavior

I would expect the proxy_set_header values to be respected. Additionally, if there is a configuration error occurring, some form of notification seems like a plus

Screenshots

I can provide these if needed

Operating System

  • RHEL 8.8
  • Docker version 24.0.5, build ced0996

Additional context

Running under compose using the following docker compose script

version: '3.8'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      - '80:80' # Public HTTP Port
      - '443:443' # Public HTTPS Port
      - '81:81' # Admin Web Port
      - '5090-6000:5090-6000' # Snag up any other ports we might want to proxy to
    volumes:
      - /opt/docker/npm/:/data

The only thing any of the log files emits on save is

[warn] 141#141: could not build optimal proxy_headers_hash, you should increase either proxy_headers_hash_max_size: 512 or proxy_headers_hash_bucket_size: 64; ignoring proxy_headers_hash_bucket_size

And on hitting the created endpoint, the following 2 things are logged (along with lots of repeated 500s of trying to get the favicon)

==> proxy-host-2_access.log <==
[15/Aug/2023:17:03:34 +0000] - 400 400 - GET http hostname.domain "/portainer/" [Client 10.0.139.109] [Length 25] [Gzip -] [Sent-to hostname.domain] "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0" "-"

==> fallback_error.log <==
2023/08/15 17:03:34 [warn] 1471#1471: 512 worker_connections are not enough, reusing connections

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions