1. The problem I’m having:
I want to rewrite every request to /wp-admin{uri}
except /wp-login.php
.
2. What I tried & What i get
I used this Caddyfile:
wordpress.example.com {
reverse_proxy :8001
@wp-login not file wp-login.php
rewrite @wp-login /wp-admin{uri}
}
And requested “wordpress.example.com/wp-login.php”.
But I get “404 Not found” from my apache webserver behind the caddy reverse proxy. And in the apache logs shows requests to “/wp-admin/wp-login.php”
3. Caddy version:
v2.7.4
4. How I installed and ran Caddy:
a. System environment:
x86_64, Podman with official Caddy docker-image
b. Command:
podman run --detach --network host \
--volume /home/root/caddy/config/:/config/ \
--volume /home/root/caddy/data/:/data/ \
--volume /home/root/caddy/Caddyfile:/etc/caddy/Caddyfile \
caddy:latest