[GH-ISSUE #4090] Cannot specify a port when configuring a new proxy host in the domain name with 2.12.1 #2660

Closed
opened 2026-02-26 07:36:22 +03:00 by kerem · 2 comments
Owner

Originally created by @codethought on GitHub (Oct 20, 2024).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/4090

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

With version 2.12.1 the ability to specify a port in the domain name when adding a new proxy host now generates an error where it did not in 2.11.3. See attached screen shots.. If this is not a bug I would like to know how to accomplish this same thing now with newer versions. Thanks.

Nginx Proxy Manager Version

2.12.1

To Reproduce
Steps to reproduce the behavior:

  1. Go to Hosts | Proxy Host
  2. Click on 'Add Proxy Host'
  3. Try to add a host with a port in the domain name
  4. See error

Expected behavior

I would expect to be able to enter a port with the domain name

Screenshots

Operating System

Docker within Unraid (Linux)

Additional context

version-2-11 3 version-2-12-1
Originally created by @codethought on GitHub (Oct 20, 2024). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/4090 <!-- Are you in the right place? - If you are looking for support on how to get your upstream server forwarding, please consider asking the community on Reddit. - If you are writing code changes to contribute and need to ask about the internals of the software, Gitter is the best place to ask. - If you think you found a bug with NPM (not Nginx, or your upstream server or MySql) then you are in the *right place.* --> **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** <!-- A clear and concise description of what the bug is. --> With version 2.12.1 the ability to specify a port in the domain name when adding a new proxy host now generates an error where it did not in 2.11.3. See attached screen shots.. If this is not a bug I would like to know how to accomplish this same thing now with newer versions. Thanks. **Nginx Proxy Manager Version** <!-- What version of Nginx Proxy Manager is reported on the login page? --> 2.12.1 **To Reproduce** Steps to reproduce the behavior: 1. Go to Hosts | Proxy Host 2. Click on 'Add Proxy Host' 3. Try to add a host with a port in the domain name 4. See error **Expected behavior** <!-- A clear and concise description of what you expected to happen. --> I would expect to be able to enter a port with the domain name **Screenshots** <!-- If applicable, add screenshots to help explain your problem. --> **Operating System** <!-- Please specify if using a Rpi, Mac, orchestration tool or any other setups that might affect the reproduction of this error. --> Docker within Unraid (Linux) **Additional context** <!-- Add any other context about the problem here, docker version, browser version, logs if applicable to the problem. Too much info is better than too little. --> <img width="1180" alt="version-2-11 3" src="https://github.com/user-attachments/assets/7603472e-e425-45bc-96fb-dd920939e140"> <img width="497" alt="version-2-12-1" src="https://github.com/user-attachments/assets/0192774d-2302-4418-86db-74082e8fc15d">
kerem 2026-02-26 07:36:22 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@yiqian987 commented on GitHub (Nov 8, 2024):

The same problem happened to me

<!-- gh-comment-id:2463941686 --> @yiqian987 commented on GitHub (Nov 8, 2024): The same problem happened to me
Author
Owner

@codethought commented on GitHub (Nov 8, 2024):

I figured out why.. this isn't a bug.. we're leveraging the proxy manager wrong... so we are in the wrong.. not NPM

In NGINX itself, If you need to set up a proxy configuration in NGINX where requests to the same server_name are forwarded to different destination ports based on the incoming port, you can do this by setting up multiple server blocks, each with a different listen port, and then using the proxy_pass directive to specify the backend (destination) port. For example:

# Incoming on port 80, proxy to port 8080
server {
    listen 80;
    server_name derp.domain;
    
    location / {
        proxy_pass http://127.0.0.1:8080;
        # Additional proxy configurations (e.g., headers, buffering)
    }
}

# Incoming on port 1234, proxy to port 9090
server {
    listen 1234;
    server_name derp.domain;
    
    location / {
        proxy_pass http://127.0.0.1:9090;
        # Additional proxy configurations
    }
}

Eventually NGINX will disable the ability to do it 'wrong' aka derp.domain:1337

And we will have to use the advanced configuration section to set up multiple proxy_pass configurations.

<!-- gh-comment-id:2465150364 --> @codethought commented on GitHub (Nov 8, 2024): I figured out why.. this isn't a bug.. we're leveraging the proxy manager wrong... so we are in the wrong.. not NPM In NGINX itself, If you need to set up a proxy configuration in NGINX where requests to the same `server_name` are forwarded to different destination ports based on the incoming port, you can do this by setting up multiple server blocks, each with a different `listen` port, and then using the `proxy_pass` directive to specify the backend (destination) port. For example: ``` # Incoming on port 80, proxy to port 8080 server { listen 80; server_name derp.domain; location / { proxy_pass http://127.0.0.1:8080; # Additional proxy configurations (e.g., headers, buffering) } } # Incoming on port 1234, proxy to port 9090 server { listen 1234; server_name derp.domain; location / { proxy_pass http://127.0.0.1:9090; # Additional proxy configurations } } ``` Eventually NGINX will disable the ability to do it 'wrong' aka `derp.domain:1337` And we will have to use the advanced configuration section to set up multiple `proxy_pass` configurations.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#2660
No description provided.