From 8051ea33e381658b63dd556c06538cf36cb0e55c Mon Sep 17 00:00:00 2001 From: aki Date: Fri, 25 Apr 2025 11:09:40 +0800 Subject: [PATCH] fix(tailscale): Use localhost and network_mode for Funnel/Serve Tailscale Funnel/Serve requires proxying to localhost or 127.0.0.1. This commit updates the target URL to http://localhost:80 and sets Traefik's network_mode to service:tailscale to allow tailscale to correctly forward traffic to the traefik container. --- docker-compose.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6e8a4d8..66e2fdc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,9 +13,10 @@ services: - --experimental.plugins.rewrite-body.version=v1.2.0 - --experimental.plugins.rewriteHeaders.modulename=github.com/XciD/traefik-plugin-rewrite-headers - --experimental.plugins.rewriteHeaders.version=v0.0.3 - ports: - - "80:80" - - "443:443" + network_mode: service:tailscale # Add this line + # ports: # Remove this section + # - "80:80" + # - "443:443" volumes: - /var/run/docker.sock:/var/run/docker.sock:ro extra_hosts: @@ -539,12 +540,12 @@ services: # --- Start Tailscale Funnel/Serve --- # Check the ENABLE_FUNNEL_HTTPS variable if [ "${ENABLE_FUNNEL_HTTPS}" = "true" ]; then - echo "ENABLE_FUNNEL_HTTPS is true. Setting up Funnel -> http://traefik:80..." - tailscale funnel --bg http://traefik:80 + echo "ENABLE_FUNNEL_HTTPS is true. Setting up Funnel -> http://localhost:80..." + tailscale funnel --bg http://localhost:80 echo "Tailscale Funnel configured." else - echo "ENABLE_FUNNEL_HTTPS is false. Setting up Serve -> http://traefik:80..." - tailscale serve --bg http://traefik:80 + echo "ENABLE_FUNNEL_HTTPS is false. Setting up Serve -> http://localhost:80..." + tailscale serve --bg http://localhost:80 echo "Tailscale Serve configured." fi # --- End Tailscale Funnel/Serve ---