Traefik configuration to allow websocket and https on the same port of a container

3.7k views Asked by At

I have a docker container (nginx) which expose only 1 port 443. This container listens to protocoles wss and https.

I need to configure my docker-compose file to push informations to my consul catalog. How can I put informations to add these 2 protocoles ?

*docker-compose.yml*:
    nginx:
      labels:
        SERVICE_443_NAME: ws-name
        SERVICE_443_TAGS: 'traefik.protocol=wss,traefik.frontend.entryPoints=wss,traefik.frontend.rule=Host:web.mydomain.com;Path=/ws'

Have you any idea to add https protocol on the same SERVICE_TAGS ?

For information, my architecture is : traefik -> consul catalog -> registrator -> container nginx

1

There are 1 answers

2
ldez On

Replace traefik.protocol=wss by traefik.protocol=https. And use the a simple https entrypoint named https.