I got mercure running on a vserver with plesk. It uses apache and nginx as reverse proxy.
In case of mercure the apache server should not be called because I configured nginx to redirect all request direclty to mercure.
location /hub/ {
proxy_pass http://localhost:3000/;
proxy_read_timeout 24h;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
And everything works fine: I get no errors, mercure is running, published updates are shown in the console and the update_topics
fits the subscribed topics but the update does not reach the client.
The updates being published by an application written in symfony 7 using api-platform with mercure: true on one entity.
When I use localhost (http://localhost:3000/.well-known/mercure) as MERCURE_URL
I get this:
INFO[0053] Update published event_id=1234566 event_retry=0 event_type= remote_addr="127.0.0.1:44380" update_targets="[]" update_topics="[https://my-url.com/api/some/topic]"
When I use my domain (https://my-domain/hub/.well-known/mercure) it goes like this:
INFO[0048] Update published event_id=1234567 event_retry=0 event_type= remote_addr={SERVER_PUBLIC_IP} update_targets="[]" update_topics="[ https://my-url.com/api/some/topic]"
It feels like I need to configure my server to allow outgoing mercure request!? But how?
Thank you for your help in advance!