NginxProxyManager / nginx-proxy-manager

Docker container for managing Nginx proxy hosts with a simple, powerful interface
https://nginxproxymanager.com
MIT License
22.89k stars 2.66k forks source link

Custom Nginx Configuration listening port issue #2993

Open dziubalabs opened 1 year ago

dziubalabs commented 1 year ago

Checklist

Describe the bug

I have 2 Proxy Hosts setup:

  1. subdomain1.domain.com (with forced SSL)
  2. subdomain2.domain.com (HTTP only)

Both point to destination http://LOCAL_IP:8080 I want 1st Proxy to listen on 80 and 443 and the 2nd Proxy to listen only on 8180, so in the 2nd settings in Advanced in 'Custom Nginx Configuration', I put:

listen 8180; server_name madzia4-test.dziubalabs.pl; location / { proxy_pass $forward_scheme://$server:$port; }

I also added

in ports: section in docker/portainer, so 8180 is available.

Whenever I try to access subdonain1 via 80 or 443, I get a connection (or redirection to 443) and that is OK. Also when I try to reach subdomain2 via 8180 it works fine.

What is not fine - or at least I think it should not work: A) subdomain1 is also available via 8180 port B) subdomain2 is also available via 80 port (but not via 443, but that is OK since there is 'HTTP only' in the setup)

It this a bug or I am setting this in a wrong way?

Nginx Proxy Manager Version

v2.10.3

To Reproduce Steps to reproduce the behavior:

  1. Add 8180:8180 to the docker in ports: section
  2. (Optional) Setup DNS and port forwarding on router
  3. Setup 2 proxy hosts as described above
  4. Populate 'Custom Nginx Configuration' for the subdomain2
  5. Open in browser http://subdomain1.domain.com:8180
  6. See that is works (and I shouldn't?)

Expected behavior

  1. With the above setup http://subdomain1.domain.com:8180 should not be accessible.
  2. With the above setup http://subdomain2.domain.com:80 should not be accessible.

Screenshots

N/A

Operating System

  1. Ubuntu 22.04 LTS (updated)
  2. Docker (latest)
  3. Portainer Community Edition 2.18.2
  4. Cloudflare as DNS
  5. Internet browser as client (any)

Additional context

N/A

github-actions[bot] commented 9 months ago

Issue is now considered stale. If you want to keep it open, please comment :+1: