1

I have installed Caddy in my CentOS 7 then I have downloaded the latest mercure that uses Caddy. I tried to run mercure using the below command:

/usr/bin/caddy run --environ --config Caddyfile.

The Caddyfile has the following config:

# Learn how to configure the Mercure.rocks Hub on https://mercure.rocks/docs/hub/config
{
    # Debug mode (disable it in production!)
    {$DEBUG}
    # HTTP/3 support
    servers {
        protocol {
            experimental_http3
        }
    }
}

{$SERVER_NAME:domain.com:4134}

log

route {
    encode zstd gzip

    mercure {
        # Transport to use (default to Bolt)
        transport_url {$MERCURE_TRANSPORT_URL:bolt://mercure.db}
        # Publisher JWT key
        publisher_jwt xxxxx
        # Subscriber JWT key
        subscriber_jwt xxxxx
        # Extra directives
        {$MERCURE_EXTRA_DIRECTIVES}
    }

    respond /healthz 200

    respond "Not Found" 404
}

I'm getting this error:

2021/08/15 18:35:14.802 INFO using provided configuration {"config_file": "Caddyfile", "config_adapter": ""} run: adapting config using caddyfile: parsing caddyfile tokens for 'route': Caddyfile:34 - Error during parsing: unrecognized directive: mercure

I do not know why it is not recognizing mercure directive. I used the provided config file. Any help please? Thanks.

Dev Dev
  • 314
  • 4
  • 17
  • I fixed it myself buy following this thread here: Error during parsing: unrecognized directive: mercure – Dev Dev Aug 16 '21 at 16:50

0 Answers0