Open kennhardy opened 1 year ago
Has anyone else gotten the websocket's working together with docker and nginx as a reverse proxy?
I haven't gotten it to work with HaProxy either. Not sure about php-zmq, it doesn't seem to be maintained any more. At least not compared to the other zmq variants.
Yes. Not sure what breaks it. I have two instances running in docker, and another two running in kubernetes. Same with both. No matter what I try, websockets does not work.
@kennhardy I have a nginx
reverse proxy, docker containers, and websockets working. Will come back to chime in on this.
@digitalextremist oh, that sounds promising. Would you be able to share your config? Are you running out in docker as well?
By the way, first impression: My configuration is very different because I have nginx
running on the host machine, and that provides individual reverse proxies to each instance running. So there is no nginx
in my docker-compose.yml
at all. Therefore also no certbot
in my docker configuration.
But looking closer at what you have, I am actually missing ESPOCRM_CONFIG_WEB_SOCKET_ZERO_M_Q_SUBMISSION_DSN
completely. I am going to add that back with a new instance and double check if I have ZMQ working as I thought. I am having no websocket problems with my configuration right now that I know of though!
Will check back.
@kennhardy I have since been able to get the part you are working with running with a reverse proxy, but I am starting to wonder if the background communications are either being dropped, or not happening. But the websocket itself is connected :)
Still have this on my mind and returning with more soon hopefully. Anything change for you?
I do see there is ICMP
traffic possible between containers though...
And when I turned on webSocketDebugMode
I do see these:
websocket | [2023-09-27 01:09:58] message newNotification for user 6501a8b5bdc913270
websocket | [2023-09-27 01:09:58] message newNotification for user 65137fa3ec7b8ac51
websocket | [2023-09-27 01:09:58] message streamUpdate.Case.651371e675bf83170 for all
Now it seems like the issue is that they never show up on the UX end.
Wait, there's the error:
@digitalextremist my config is much like yours. do you get notifications and reminders or you also have problem?
I was able to get this worked out @Shahin-rmz
Would need to recall, but I think I completely redid my configuration after this point.
I was able to get this worked out @Shahin-rmz
Would need to recall, but I think I completely redid my configuration after this point.
It would be awesome if you share your docker compose, nginx Proxy manager config whenever you have time. Thanks
Did anybody solve the websocket issue? I'm experiencing the same behind traefik. Would be great to get feedback.
Example Traefik labels for Websocket container:
# Traefik
traefik.enable: 'true'
traefik.docker.network: traefik-proxy # Use your own network
# Traefik for EspoCRM Websocket
traefik.http.routers.espocrm-ws.rule: Host(`example.com`) && PathPrefix(`/ws`) # Use your own domain
traefik.http.routers.espocrm-ws.entrypoints: websecure # Use your own entrypoint
traefik.http.routers.espocrm-ws.tls: 'true'
traefik.http.routers.espocrm-ws.tls.certresolver: cloudflare # Use your own certresolver
traefik.http.routers.espocrm-ws.service: espocrm-ws-svc
traefik.http.services.espocrm-ws-svc.loadbalancer.server.port: '8080'
And in the environment:
ESPOCRM_CONFIG_USE_WEB_SOCKET: 'true'
ESPOCRM_CONFIG_WEB_SOCKET_URL: wss://example.com/ws # Use your own domain
ESPOCRM_CONFIG_WEB_SOCKET_ZERO_M_Q_SUBSCRIBER_DSN: tcp://*:7777
ESPOCRM_CONFIG_WEB_SOCKET_ZERO_M_Q_SUBMISSION_DSN: tcp://websocket:7777 # Assuming the service name is 'websocket'
Thanks a lot! I additionally had to map port 8080 to 8443 explicitly -- what should be standard -- but seems to works now. It took me a serious number of attempts to convince Google Chrome to accept the connection (even in Incognito Mode) -- but since Firefox did not throw errors I kept trying -- and all of a sudden it worked. I will observe it now and get back in a couple of days.
When using docker, either configuring everything manually with a regular setup or when using the install script, websocket is not working. Something seems to be missing from a regular setup using php. It seems nginx are not able to understans or translate the zmq and hence not becoming a socket. Instead only reaching the endpoint over http(s).
After spending countless hours on this I decided to cash up for a VM to try it outside my current hosting setup and came to the same conclusion result. Or I might be missing something fundamental, if so I'd love some help.
"auto-install" with ssh: