Reverse proxy not working (partially)

I’m setting up caddy as a reverse proxy in front of nginx to serve a wordpress website. Caddy and nginx is located on different server.

The website is working. However, when I try to enter an url like (which is exist folder), instead of going to the wp-admin page (forwarding to wp-login.php), caddy display an error “refused to connect” with address showing
Same problem if trying to enter other exist folder like wp-content…

My Caddyfile is as following: {
    tls {
        dns cloudflare
        key_type rsa4096
} {
    errors /var/log/caddy/errors.log
    gzip { level 9 }
    proxy / {

Is there anything I did wrong here? Sorry I’m very new to this reverse proxy. Also, why did the error page showing the forwarding port here? Would this affect the security? How can I stop caddy to showing the forwarding port?

Hi @ltv, welcome to the Caddy community.

Can you post the exact error you’re getting, the exact URL you were trying to navigate to, and the exact URL you end up with (please copy+paste all three).

You could also post the output of running curl -IL from any computer, and possibly the output of curl -ILH "" run from the Caddy host machine.

I also note you have errors configured. What appears in this log when you get this error?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.