[GH-ISSUE #4142] Proxy Host Location with 2 Apache containers #2688

Open
opened 2026-02-26 07:36:28 +03:00 by kerem · 3 comments
Owner

Originally created by @Kydaix on GitHub (Nov 6, 2024).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/4142

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 impression that there's a problem with the rental system. I'm just trying to set up 2 Apache containers with Nginx Proxy Manager.

In my case, I'm working in localhost. I can set up a proxy host which is the first Apache container. I then create a “/test” location on it, which redirects to the second container. The setting in the proxy host still works. However, the location doesn't. I can invert the 2 and the roles are reversed! I hope I'm right in reporting this as a bug.

Nginx Proxy Manager Version
2.12.1

To Reproduce
Steps to reproduce the behavior:

  1. Create a docker-compose.yml with "jc21/nginx-proxy-manager:latest" and two "httpd:latest" with different container names.
  2. Link them all through a network.
  3. Start the Docker stack and connect to Nginx Proxy Manager.
  4. Add a proxy host with the domain name “localhost”, the ip with the name of the first Apache container (“site-1” in my case) on port 80.
  5. On the same proxy host, add a “/test” location that redirects to the second Apache container ("site-2" in my case) on port 80.
  6. Go to “localhost”, which works, then to "localhost/test" which does not.

Expected behavior
When I go to the "/test" location, I should be redirected to my second Apache container.

Screenshots
image
image
image
image

Operating System
Windows 10 (22H2 - 19045.5073)

Additional context

services:

  proxy:
    image: 'jc21/nginx-proxy-manager:latest'
    container_name: nginx-proxy-manager
    restart: unless-stopped
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
    networks:
      - web

  site-1:
    image: httpd:latest
    container_name: site-1
    restart: always
    volumes:
      - ./site-1:/usr/local/apache2/htdocs
    networks:
      - web

  site-2:
    image: httpd:latest
    container_name: site-2
    restart: always
    volumes:
      - ./site-2:/usr/local/apache2/htdocs
    networks:
      - web

networks:
  web:
Originally created by @Kydaix on GitHub (Nov 6, 2024). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/4142 <!-- 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** I have the impression that there's a problem with the rental system. I'm just trying to set up 2 Apache containers with Nginx Proxy Manager. In my case, I'm working in localhost. I can set up a proxy host which is the first Apache container. I then create a “/test” location on it, which redirects to the second container. The setting in the proxy host still works. However, the location doesn't. I can invert the 2 and the roles are reversed! I hope I'm right in reporting this as a bug. **Nginx Proxy Manager Version** 2.12.1 **To Reproduce** Steps to reproduce the behavior: 1. Create a docker-compose.yml with "jc21/nginx-proxy-manager:latest" and two "httpd:latest" with different container names. 2. Link them all through a network. 3. Start the Docker stack and connect to Nginx Proxy Manager. 4. Add a proxy host with the domain name “localhost”, the ip with the name of the first Apache container (“site-1” in my case) on port 80. 5. On the same proxy host, add a “/test” location that redirects to the second Apache container ("site-2" in my case) on port 80. 6. Go to “localhost”, which works, then to "localhost/test" which does not. **Expected behavior** When I go to the "/test" location, I should be redirected to my second Apache container. **Screenshots** ![image](https://github.com/user-attachments/assets/f235bec5-9cfa-49de-a863-1ba0c4b71302) ![image](https://github.com/user-attachments/assets/ef50a105-8ad3-4602-9edb-3ef80feb4580) ![image](https://github.com/user-attachments/assets/13607714-0894-4e71-b0f0-62fb7ab45b3a) ![image](https://github.com/user-attachments/assets/07792eac-f038-4cf0-9ea1-6c578d3d7c68) **Operating System** Windows 10 (22H2 - 19045.5073) **Additional context** ``` services: proxy: image: 'jc21/nginx-proxy-manager:latest' container_name: nginx-proxy-manager restart: unless-stopped ports: - '80:80' - '81:81' - '443:443' volumes: - ./data:/data - ./letsencrypt:/etc/letsencrypt networks: - web site-1: image: httpd:latest container_name: site-1 restart: always volumes: - ./site-1:/usr/local/apache2/htdocs networks: - web site-2: image: httpd:latest container_name: site-2 restart: always volumes: - ./site-2:/usr/local/apache2/htdocs networks: - web networks: web: ```
Author
Owner

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

Probably your app on site-2 also needs to have the subpath /test.

I'm not very familiar with nginx-proxy-manager yet, but I don't think it's rewriting urls. It's just forwarding the request to another server.

So localhost/test is forwarded to site-2 as site-2/test.

<!-- gh-comment-id:2465896465 --> @leroy0211 commented on GitHub (Nov 8, 2024): Probably your app on `site-2` also needs to have the subpath `/test`. I'm not very familiar with nginx-proxy-manager yet, but I don't think it's rewriting urls. It's just forwarding the request to another server. So `localhost/test` is forwarded to `site-2` as `site-2/test`.
Author
Owner

@Kydaix commented on GitHub (Dec 16, 2024):

Sorry for the delay. Thanks for your reply, however, despite your configuration, I haven't managed to get it to work the way I wanted. Nothing changes... :(

<!-- gh-comment-id:2545182911 --> @Kydaix commented on GitHub (Dec 16, 2024): Sorry for the delay. Thanks for your reply, however, despite your configuration, I haven't managed to get it to work the way I wanted. Nothing changes... :(
Author
Owner

@github-actions[bot] commented on GitHub (Jun 26, 2025):

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

<!-- gh-comment-id:3006810548 --> @github-actions[bot] commented on GitHub (Jun 26, 2025): Issue is now considered stale. If you want to keep it open, please comment :+1:
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#2688
No description provided.