Hi. I've setup EspoCRM in a docker environment. Everything except websocket is working. Now been banging my head against the issue too long and any help would be appreciated.
Using docker-compose:
And Nginx as a reverse proxy:
I've tried to proxy pass directly to 8039 port as well, but same result where browser is not able to connect. Console output:
I also tried to connect directly to the socket on the host using wscat (ws instead of wss since its before the proxy), but it might seem there is no socket running in the docker container?
Using docker-compose:
Code:
version: "2.2" services: espocrm: image: espocrm/espocrm container_name: espocrm environment: ESPOCRM_DATABASE_HOST: 172.17.0.1 ESPOCRM_DATABASE_USER: dbuser ESPOCRM_DATABASE_NAME: dbname ESPOCRM_DATABASE_PASSWORD: "dbpass" ESPOCRM_ADMIN_USERNAME: admin ESPOCRM_ADMIN_PASSWORD: "adminpass" ESPOCRM_SITE_URL: "https://crm.domain.tld" volumes: - ./config/espocrm:/var/www/html restart: always ports: - 127.0.0.1:8038:80 espocrm-daemon: image: espocrm/espocrm container_name: espocrm-daemon volumes: - ./config/espocrm:/var/www/html restart: always entrypoint: docker-daemon.sh espocrm-websocket: image: espocrm/espocrm container_name: espocrm-websocket environment: ESPOCRM_CONFIG_USE_WEB_SOCKET: "true" ESPOCRM_CONFIG_WEB_SOCKET_URL: "wss://crm.domain.tld/ws" ESPOCRM_CONFIG_WEB_SOCKET_ZERO_M_Q_SUBSCRIBER_DSN: "tcp://*:7777" ESPOCRM_CONFIG_WEB_SOCKET_ZERO_M_Q_SUBMISSION_DSN: "tcp://espocrm-websocket:7777" volumes: - ./config/espocrm:/var/www/html restart: always entrypoint: docker-websocket.sh ports: - 127.0.0.1:8039:8080
And Nginx as a reverse proxy:
Code:
location / { include proxy_params; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_pass http://localhost:8038/; } location /ws { proxy_http_version 1.1; proxy_buffering off; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_pass http://localhost:8038; }
I've tried to proxy pass directly to 8039 port as well, but same result where browser is not able to connect. Console output:
Code:
autobahn.js:341 WebSocket connection to 'wss://crm.domain.tld/ws?authToken=a8e6a24291d51951e9980116f2b2f480&userId=1' failed: ab.Session @ autobahn.js:341 autobahn.js:341 WebSocket connection to 'wss://crm.domain.tld/ws?authToken=a8e6a24291d51951e9980116f2b2f480&userId=1' failed: ab.Session @ autobahn.js:341 autobahn.js:341 WebSocket connection to 'wss://crm.domain.tld/ws?authToken=a8e6a24291d51951e9980116f2b2f480&userId=1' failed: ab.Session @ autobahn.js:341
Code:
wscat -c ws://127.0.0.1:8038 - error: Unexpected server response: 200 wscat -c ws://127.0.0.1:8038/ws - error: Unexpected server response: 404 wscat -c ws://127.0.0.1:8038/wss - error: Unexpected server response: 404 wscat -c ws://127.0.0.1:8039 - error: Unexpected server response: 426 wscat -c ws://127.0.0.1:8039/ws - error: Unexpected server response: 426 wscat -c ws://127.0.0.1:8038/wss - error: Unexpected server response: 404
Comment