Unrecognized directive: http://prod.abc.net

I’m new to Caddy and have been experimenting a lot lately on it, but I’m stuck on the below issue.

1. Caddy version (caddy version): v2

2. How I run Caddy: cmd+Caddyfile

a. System environment: Ubuntu 18.04

b. Command: caddy run/start

c. Service/unit/compose file: N/A

d. My complete Caddyfile or JSON config:

http://prod.abc.net{
    reverse_proxy http://status.aws.amazon.com
}

http://blog.abc.net{
    reverse_proxy http://localhost:8080
}

3. The problem I’m having:

When trying to run caddy I get the following error :

run: adapting config using caddyfile: /web/prod.caddy:1: unrecognized directive: http://prod.abc.net{

5. What I already tried:

Tried it without the curly braces still gets the same error.
:

Please note I’m trying this without https, I only want to test it on my local system.

You must have spaces between your domain and the curly brace. Caddy is parsing those as being a single token otherwise.

Thank you so much francislavoie, sometimes this little things eats up your whole day. Thanks again for the help. It worked like a charm.

1 Like

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