My own App - docker deployed to openvidu server

I have my own app (based largely on tutorial - Get A room) a one to many program in nodeJS.

I have this working on a separate server. But I wanted to dockerise and deploy on the same server as openvidu.

I have followed the deployment guide but, I am unable to connect to the app, I get a 502 bad gateway when accessing the root URL.

nginx logs shows this error

nginx_1 | 2020/12/06 15:44:10 [error] 79#79: *1 upstream prematurely closed connection while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: xxxxxx.xxxx.com, request: “GET / HTTP/1.1”, upstream: “http://127.0.0.1:5442/”, host: “xxxxxx.xxxx.com

My server.js is listening to port 5000, and the docker-compose-ovveride.yml is configured like this

app:
    image: xxx/xxx:latest
    restart: on-failure
    ports:
        - "5442:5000"
    environment:
        - SERVER_PORT=5442
        - OPENVIDU_URL=http://localhost:5443
        - OPENVIDU_SECRET=${OPENVIDU_SECRET}
        - CALL_OPENVIDU_CERTTYPE=${CERTIFICATE_TYPE}
    logging:
        options:
            max-size: "${DOCKER_LOGS_MAX_SIZE:-100M}"

I am able to access the page by https://:5442

any help greatly appreciated…

Richard

Try to use network host. If your app is available in http://127.0.0.1:5442 there should be no problem. Try to access some endpoint in your server by using curl and http://127.0.0.1:5442. If you’re able to access it, the nginx proxy should be able to redirect all requests.

Regards,
Carlos

Hi Carlos,

Many thanks for the reply… I eventually made it work… What I missed was changing the node server from https to http…

Many thanks,

Richard

great software by the way… really appreciate your work!
:slight_smile: