Subdir reverse_proxy fails while subdomain reverse_proxy works perfectly

1. Output of caddy version:


2. How I run Caddy:

caddy start

a. System environment:

5.15.63-0-lts #1-Alpine SMP Mon, 29 Aug 2022 07:17:28 +0000 x86_64 Linux

b. Command:

caddy start

c. Service/unit/compose file:


d. My complete Caddy config: {
        encode gzip
        reverse_proxy localhost:8080
        @disallowed {
               path /xmlrpc.php
               path *.sql
               #path /wp-content/uploads/*.php
        rewrite @disallowed '/index.php'
        reverse_proxy /xr/*
} {
        @blocked not remote_ip
        respond @blocked "<h1>Access Denied</h1>" 403

3. The problem I’m having:

While works brilliantly, fails, showing:
Cannot GET /mc/

4. Error messages and/or full log output:

No errors,  just does not work.

5. What I already tried:

I tried using handle, handle_path, route, had to learn about without not working… I can easily do this in traefik (which is crazy since I moved to caddy to to traefik breaking from being so complex)

6. Links to relevant resources:

See this article, which explains:

1 Like

Thank you for the article. It certainly explains the issue. It looks like subdomains are the way to go, as the advanced option looks much more difficult. Thank you @francislavoie !

1 Like

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