[GH-ISSUE #1164] Custom Path for the Same Domain #1789

Closed
opened 2026-04-16 08:36:51 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @afunworm on GitHub (Jul 29, 2025).
Original GitHub issue: https://github.com/fosrl/pangolin/issues/1164

Hello.

I'm trying to use Pangolin in front of Appwrite. As you can see in their Docker compose file:

  • If traffic is requesting /, use the container appwrite:80.
  • If traffic is requesting /console, use the container appwrite-console:80.
  • If traffic is requesting /v1/realtime, use appwrite-realtime:80

How do I achieve this in Pangolin?

Originally created by @afunworm on GitHub (Jul 29, 2025). Original GitHub issue: https://github.com/fosrl/pangolin/issues/1164 Hello. I'm trying to use Pangolin in front of Appwrite. As you can see in their Docker [compose file](https://appwrite.io/install/compose): - If traffic is requesting `/`, use the container appwrite:80. - If traffic is requesting `/console`, use the container appwrite-console:80. - If traffic is requesting `/v1/realtime`, use appwrite-realtime:80 How do I achieve this in Pangolin?
Author
Owner

@bcrooker commented on GitHub (Jul 30, 2025):

I don't think you can currently, but this would be a great feature - it is the biggest gap for me between pangolin vs cloudflare tunnels.

<!-- gh-comment-id:3137018617 --> @bcrooker commented on GitHub (Jul 30, 2025): I don't think you can currently, but this would be a great feature - it is the biggest gap for me between pangolin vs cloudflare tunnels.
Author
Owner

@afunworm commented on GitHub (Jul 30, 2025):

I don't think you can currently, but this would be a great feature - it is the biggest gap for me between pangolin vs cloudflare tunnels.

Is there any way for us to push this to the roadmap? Quiet a couple of my apps require this kind of setup or it just doesn't work.

<!-- gh-comment-id:3137308448 --> @afunworm commented on GitHub (Jul 30, 2025): > I don't think you can currently, but this would be a great feature - it is the biggest gap for me between pangolin vs cloudflare tunnels. Is there any way for us to push this to the roadmap? Quiet a couple of my apps require this kind of setup or it just doesn't work.
Author
Owner

@ryanehamil commented on GitHub (Jul 31, 2025):

This probably gets into some intricacies of traefik handling. I ran into this as well when I was setting up headscale. I wanted a gui at the /admin page. In the end the simplest solution for me was a tiny NGINX alpine sidecar.

Point the resource to the NGINX and use a config file to direct "/" to one container and "/admin" to the other.

My files are a mess but I will try to share this workaround when I get back to a pc.

<!-- gh-comment-id:3138200207 --> @ryanehamil commented on GitHub (Jul 31, 2025): This probably gets into some intricacies of traefik handling. I ran into this as well when I was setting up headscale. I wanted a gui at the /admin page. In the end the simplest solution for me was a tiny NGINX alpine sidecar. Point the resource to the NGINX and use a config file to direct "/" to one container and "/admin" to the other. My files are a mess but I will try to share this workaround when I get back to a pc.
Author
Owner

@ryanehamil commented on GitHub (Jul 31, 2025):

Sample of compose.yml that contains the two services that will run at the same domain

router:
    container_name: headscale-router
    image: nginx:alpine
    restart: unless-stopped
    networks:
      - internet
      - pangolin_transport
      - headscale_internal
    expose:
      - '80'
    volumes:
      - './router-config/nginx.conf:/etc/nginx/nginx.conf:ro'

The conf file referenced above. The container names are headscale and headplane and it point to their respective listening ports.

events {
    worker_connections 1024;
}

http {
    # Basic settings
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;
    client_max_body_size 16M;

    # Upstream servers
    upstream headscale {
        server headscale:8080;
    }

    upstream headplane {
        server headplane:3000;
    }

    # Main server block
    server {
        listen 80;
        server_name _;

        # Health check endpoint
        location /health {
            access_log off;
            return 200 "healthy\n";
            add_header Content-Type text/plain;
        }

        # Route /admin to headplane
        location = /admin {
            proxy_pass http://headplane;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_redirect off;
        }

        # Route /admin/ (with trailing slash) to headplane
        location /admin/ {
            proxy_pass http://headplane;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_redirect off;
        }

        # Route everything else to headscale
        location / {
            proxy_pass http://headscale;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_redirect off;

            # WebSocket support (if needed for headscale)
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }
    }
}
<!-- gh-comment-id:3138204869 --> @ryanehamil commented on GitHub (Jul 31, 2025): Sample of compose.yml that contains the two services that will run at the same domain ```yaml router: container_name: headscale-router image: nginx:alpine restart: unless-stopped networks: - internet - pangolin_transport - headscale_internal expose: - '80' volumes: - './router-config/nginx.conf:/etc/nginx/nginx.conf:ro' ``` The conf file referenced above. The container names are headscale and headplane and it point to their respective listening ports. ```conf events { worker_connections 1024; } http { # Basic settings sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; client_max_body_size 16M; # Upstream servers upstream headscale { server headscale:8080; } upstream headplane { server headplane:3000; } # Main server block server { listen 80; server_name _; # Health check endpoint location /health { access_log off; return 200 "healthy\n"; add_header Content-Type text/plain; } # Route /admin to headplane location = /admin { proxy_pass http://headplane; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_redirect off; } # Route /admin/ (with trailing slash) to headplane location /admin/ { proxy_pass http://headplane; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_redirect off; } # Route everything else to headscale location / { proxy_pass http://headscale; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_redirect off; # WebSocket support (if needed for headscale) proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } } } ```
Author
Owner

@oschwartz10612 commented on GitHub (Jul 31, 2025):

Hi! Yes we want to do this soon and I actually will put it on the roadmap. I think this is a duplicate though so I am going to close this.

<!-- gh-comment-id:3140903441 --> @oschwartz10612 commented on GitHub (Jul 31, 2025): Hi! Yes we want to do this soon and I actually will put it on the roadmap. I think this is a duplicate though so I am going to close this.
Author
Owner

@gitizenss commented on GitHub (Aug 13, 2025):

@oschwartz10612 Been using pangolin for a while, its awesome. This would be the most important feature addition for me, by far.

<!-- gh-comment-id:3186023354 --> @gitizenss commented on GitHub (Aug 13, 2025): @oschwartz10612 Been using pangolin for a while, its awesome. This would be the most important feature addition for me, by far.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/pangolin#1789