Exclude path from reverse proxy

Can somebody please show me example of excluding path from reverse proxy?

As for example, I need to exclude /wp-admin/* directory path and all other reverse proxy to:

reverse_proxy * cdn.mysite.com:443

Kindly

Hi @sslamsal,

Have you looked at request matchers? You could use not path to match only requests that aren’t /wp-admin/* - there’s some examples in the documentation.

Request matchers (Caddyfile) — Caddy Documentation
Request matchers (Caddyfile) — Caddy Documentation

1 Like

Ok this one looks working:

@exc {
not path /wp-admin/*
}
reverse_proxy @exc cdn.mysite.com:443

Thanks @Whitestrake

2 Likes

This topic was automatically closed after 30 days. New replies are no longer allowed.