Files
my-docs/Web Servers & Reverse Proxies/Traefik/1-Information.md
2025-08-13 22:58:36 +03:30

84 lines
1.8 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 🚦 **Traefik Overview**
**Traefik** is a **modern reverse proxy** and load balancer that makes deploying, securing, and managing microservices easier.
---
## 🔄 **Core Concepts**
### 1⃣ **Entrypoint** 🛬
* The starting point for **incoming requests**.
* Example: `:80` for HTTP or `:443` for HTTPS.
### 2⃣ **Router** 🚏
* Decides **where a request should go** based on rules.
* Connects **entrypoints** to **services**.
### 3⃣ **Service** 🛠️
* The actual application or backend that processes the request.
---
## 🧩 **Routers Details**
**Routers** can have:
1. **Middleware** 🧱
* Modify requests/responses before reaching the service.
* Examples:
* `StripPrefix` ➡️ Remove part of the URL path.
* `RateLimit` ➡️ Limit request rate.
* `Auth` ➡️ Add authentication.
2. **Rules** 📜
* Define **how to match a request**.
* Examples:
* `Host("example.com")`
* `PathPrefix("/api")`
---
## ⚙️ **Traefik Configuration Types**
1. **Static Configuration** 🗂️
* Defines **Traefiks own behavior**.
* Example: entrypoints, providers, log level.
* Set in `traefik.yml` or CLI args.
2. **Dynamic Configuration** 📡
* Defines **how Traefik routes requests**.
* Example: routers, services, middlewares.
* Comes from files, Kubernetes CRDs, or Docker labels.
---
## 🔗 **Request Flow**
```
Request
⬇️
Entrypoint 🛬
⬇️
Router 🚏
⬇️
Middleware 1 🧱 → Middleware 2 🧱
⬇️
Service 🛠️
```
---
## 🌟 **Summary**
Traefik acts like a **smart traffic cop** 🚓 for your microservices, ensuring that requests go exactly where they should, with the right rules and transformations applied along the way.