I have set up Traefik reverse proxy and for Wordpress I'm using Caddy2 and PHP-FPM, but I think this problem is related to Traefik.
My problem is that everything i redirected to a trailing slash, that means wp-content/script.js
is 301
redirected to wp-content/script.js
.
This is my Traefik docker-compose. Do I need to modify something here?
version: '3'
services:
reverse-proxy:
restart: unless-stopped
image: traefik:v2.4
command:
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --entrypoints.web.http.redirections.entryPoint.to=websecure
- --entrypoints.web.http.redirections.entryPoint.scheme=https
- --entrypoints.web.http.redirections.entrypoint.permanent=true
- --providers.docker
- --providers.docker.network=web
- --certificatesresolvers.leresolver.acme.caserver=https://acme-v02.api.letsencrypt.org/directory
- --certificatesresolvers.le.acme.email=null@email.nowhere
- --certificatesresolvers.leresolver.acme.storage=/acme.json
- --certificatesresolvers.leresolver.acme.tlschallenge=true
labels:
- traefik.docker.network=web
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- web
networks:
web:
external: true