NginxProxyManager / nginx-proxy-manager

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

Proxy Host Location with 2 Apache containers #4142

Open Kydaix opened 1 week ago

Kydaix commented 1 week ago

Checklist

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:
leroy0211 commented 1 week ago

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.