dunglas / mercure

🪽 An open, easy, fast, reliable and battery-efficient solution for real-time communications
https://mercure.rocks
GNU Affero General Public License v3.0
3.98k stars 296 forks source link

admin.api request error {"error": "host not allowed: api.sub.mydomain.com", "status_code": 403} #957

Closed ma-gu-16 closed 1 month ago

ma-gu-16 commented 1 month ago

Hi,

im getting the following error:

admin.api request error {"error": "host not allowed: api.sub.mydomain.com", "status_code": 403}

while i try to connect to mercure.

my config:

{ debug {$GLOBAL_OPTIONS} admin 10.10.xx.xx:2019 skip_install_trust local_certs auto_https off }

{$CADDY_EXTRA_CONFIG}

https://api.sub.mydomain.com:2019 { log { format filter { fields { request>uri query { replace authorization REDACTED } } } }

encode zstd gzip

mercure {
    transport_url {$MERCURE_TRANSPORT_URL:bolt://mercure.db}
    publisher_jwt xxxxxxx
    subscriber_jwt xxxxxx
    publish_origins https://api.sub.mydomain.com http://api.sub.mydomain.com
    cors_origins https://api.sub.mydomain.com http://api.sub.mydomain.com
    {$MERCURE_EXTRA_DIRECTIVES}
}

{$CADDY_SERVER_EXTRA_DIRECTIVES}

log_skip /robots.txt
log_skip /healthz
log_skip /favicon.ico

respond /healthz 200
respond "Not Found" 404

}

Edit: its not possible to make a codeblock around the config :(

ma-gu-16 commented 1 month ago

with this global conf it works:

{ debug {$GLOBAL_OPTIONS} admin 10.10.xx.xx:2019 { origins https://api.sub.mydomain.com } skip_install_trust local_certs auto_https off }