Buy Me a Coffee
Traefik Docker Swarm Logout Issue Illustration

Refreshing Web Page Logs Out the User When Using Traefik in Docker Swarm

1. Introduction If you use Traefik as the reverse proxy in a Docker Swarm cluster, and your application is server-side rendered (SSR), you may encounter the following issue: You can log in successfully But when you refresh the page or navigate to another page, you are suddenly logged out The behavior feels random: sometimes it works, sometimes it doesn’t This issue usually does not appear: when running the app locally when using only one container before scaling the service in Docker Swarm Once you add multiple replicas, the problem starts to show up. This post will explore the reasons behind this behavior and how to effectively address it. ...

Traefik routing issue between frontend and backend containers

[Docker/Traefik] Resolving Intermittent Frontend Loading and 504 Errors Behind a Traefik Reverse Proxy (Update 2025-11)

We encountered a frustrating issue in our Dockerized app environment where the frontend service was intermittently failing to load, and backend API calls were stuck or returning 504 Gateway Timeout errors. Our infrastructure consists of: Frontend container (React app) Backend API container (Go server, accessible at /api/...) Database container (PostgreSQL) Traefik reverse proxy managing HTTPS termination and routing Despite having valid TLS certs and seemingly working routes, users experienced broken pages, incomplete frontend rendering, and stuck fetch requests to /api endpoints. ...

Forwarding Real Client IP in Docker Swarm

How to Forward the Real Client IP Through Traefik in Docker Swarm

Introduction In some applications, getting the real client IP address is critical. For example, web APIs, analytics systems, or rate-limiting middleware rely on it for logging, geo-location, or security. Normally, this is not a challenge. The backend can read the IP directly from X-Forwarded-For or the socket connection. However, when the application is deployed behind a Traefik proxy and running as a Docker Swarm service, things become complicated. The Issue Understanding the Request Path When an application is deployed behind Traefik in Swarm, one might assume the network request path is straightforward: ...

traefik reverse proxy to non-containerized service

[Traefik/OCI] Exposing Internal Non-Containerized Services with Traefik on OCI: A Step-by-Step Guide

Traefik is a popular reverse proxy that can be used to expose internal containerized services to the public in a simple and intuitive way. However, if you want to expose internal services that are installed and configured directly on the host system instead of containerized, you may encounter some difficulties, particularly when using Oracle Cloud Infrastructure (OCI). This technical post will provide a step-by-step guide on how to expose internal non-containerized services to the public using Traefik on OCI. ...

DigitalOcean Referral Badge
Sign up to get $200, 60-day account credit !