traefik: demo/app upstream to web is plain http over the public IP; use the tailnet #243
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found 2026-10-16 while answering where Traefik and nginx sit. Improvement, not an incident.
Today
roles/traefik/templates/base.yml.j2: thewebappsservice (used bydemo.jfraeys.comandapp.jfraeys.com) forwards to{{ web_apps_scheme }}://{{ hostvars[groups['web_hosts'][0]]['public_ipv4'] }}:{{ web_apps_port }}, withweb_apps_scheme: httpandweb_apps_port: 80(inventory/group_vars/all.yml). So Traefik onservicestalks plain HTTP to nginx onwebover the web node'spublic IP.
Problems
it already points at
ovh-web(which has no nginx yet, so demo and app return 502 there until the app is deployed).Not a problem (corrects an earlier remark)
Web's port 80 cannot be closed to the public as a result: the web node serves
jfraeys.com/wwwitself on 80/443 (those recordspoint at it directly through Cloudflare). The gain is encryption and stability, not a smaller exposed surface.
Options
web.ts.jfraeys.com(issues #241/#242). The name follows theHeadscale node name, so the cutover name swap moves it automatically. Catch: servers join with
--accept-dns=falseand Traefik runs inDocker, so a name does not resolve there today; the tailnet IP can come from
tailscale ip -4on the web host (a fact gathered by the role).tag:servicesto reachtag:web:80.Done when
webappspoints at the web node over the tailnet, demo and app still work, and the runbook's cutover steps no longer need to mention this upstream.Implemented in #244 (merged) and verified after the deploy: Traefik's webapps upstream is http://100.64.0.1:80 (the web node's tailnet address); demo.jfraeys.com and app.jfraeys.com answer as before; web's nginx log shows source 100.64.0.3 and no new requests from the services node's public address. Fallback to the public address and web_apps_use_tailnet: false remain available.