Good morning,
I use the Mercure image to send notifications via Symfony.
If I run everything locally, it works correctly, but if I try to deploy on a server with an associated domain, I have issues with Mercure and the SSL certificate.
My configuration is as follows:
webapp:
image: ***/nginx
networks:
- default
- reverseproxy
volumes_from:
- phpfpm
environment:
VIRTUAL_HOST: api.example.it
LETSENCRYPT_HOST: api.example.it
LETSENCRYPT_EMAIL: ***@***.it
CLIENT_MAX_BODY_SIZE: 48M
restart: unless-stopped
phpfpm:
image: image-server:latest
volumes:
- ./vendor:/app/vendor
- ./resources:/app/resources
restart: unless-stopped
environment:
MAX_UPLOAD_SIZE: 48M
POST_MAX_SIZE: 48M
mercure:
image: dunglas/mercure
environment:
SERVER_NAME: ':443'
MERCURE_URL: 'https://api.example.it/.well-known/mercure'
MERCURE_PUBLIC_URL: 'https://api.example.it/.well-known/mercure'
MERCURE_SUBSCRIBER_JWT_KEY: '***************************'
MERCURE_PUBLISHER_JWT_KEY: '***************************'
ALLOW_ANONYMOUS: 1
CORS_ALLOWED_ORIGINS: 'https://example.it'
PUBLISH_ALLOWED_ORIGINS: '*'
MERCURE_EXTRA_DIRECTIVES: |-
cors_origins "https://example.it"
anonymous
ADDR: ':443'
ports:
- '1338:443'
The error I encounter is always the following: [I will add the image]
Errore che si presenta
I have made many attempts, but I always end up with the error shown in the image.
Can anyone help me? I’m surely making a mistake in the container configuration, but I can’t figure out where.
On the server, I use a reverse proxy, and the image also assigns the certificate to the domain present in Nginx.
Thank you very much.
My attempts have focused on the container configuration. I tried setting the address to https://api.example.it:1338 with a port, but I don’t think this is correct.
I looked through the documentation but couldn’t quite understand how to resolve the issue. I believe that the domain doesn’t need to be re-certified, but I could be wrong.