I thought I had it, but nope, still no joy.
Initially, I associated the middleware with the wrong router, but then it occurred to me that it needs to be associated with the router for the WordPress website. Here's the way it's configured now (what I thought I needed)...
services:
webserver_nginx:
image: nginx:1.19-alpine
container_name: webserver_nginx
restart: unless-stopped
volumes:
# Configuration files for nginx
#
- ./nginx/nginx-conf:/etc/nginx/conf.d
labels:
- "traefik.enable=true"
- "traefik.http.routers.mysite_rtr.tls=true"
- "traefik.http.routers.mysite_rtr.entrypoints=websecure"
# Define middleware to enable gzip compression
- "traefik.http.middlewares.wp_compress.compress=true"
# Associate that middleware with relevant routers.
- "traefik.http.routers.mysite_rtr.middlewares=wp_compress"
networks:
app_net:
I do see it in the Middlewares section of the dashboard, but how do I see if it's "associated with" a router? The compress middleware is not mentioned anywhere on the Routers dashboard page.
It's well over 1400 bytes, which is what the docs say is the minimum for compression to kick in. Plus, for other requests which do have content-length header in the response, there's still no content-encoding header.
I'm stumped right now.