Last active
October 4, 2023 13:51
-
-
Save fatihyildizhan/e1d9d909049f0a67a7d1585468193438 to your computer and use it in GitHub Desktop.
Traefik v2 - How to enable gzip compression
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Traefik v2 docker-compose.yml | |
version: '3.7' | |
services: | |
traefik: | |
image: traefik:v2.2.7 | |
container_name: traefik | |
labels: | |
. | |
. | |
. | |
// paste on the last line to enable gzip compression | |
- "traefik.http.routers.traefik.middlewares=traefik-compress" | |
- "traefik.http.middlewares.traefik-compress.compress=true" | |
### Your container docker-compose.yml | |
version: '3.7' | |
services: | |
your_service_name: | |
image: your_image_url | |
container_name: your_container_name | |
labels: | |
. | |
. | |
. | |
// paste on the last line to enable gzip compression | |
- "traefik.http.middlewares.your_container_name_compress.compress=true" | |
- "traefik.http.routers.your_container_name.middlewares=your_container_name_compress" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
in my case it was enough to add two labels to traefik service, no additional labels to other containers