【问题标题】:Traefik configuration to allow websocket and https on the same port of a containerTraefik 配置以允许容器的同一端口上的 websocket 和 https
【发布时间】:2018-10-04 21:07:00
【问题描述】:

我有一个 docker 容器 (nginx),它只公开 1 个 443 端口。这个容器监听协议 wsshttps

我需要配置我的 docker-compose 文件以将信息推送到我的领事目录。如何添加信息以添加这 2 个协议?

*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'

你有什么想法在同一个 SERVICE_TAGS 上添加 https 协议吗?

参考一下,我的架构是:traefik -> consul catalog -> registrator -> container nginx

【问题讨论】:

    标签: docker docker-compose consul traefik registrator


    【解决方案1】:

    traefik.protocol=wss 替换为traefik.protocol=https。 并使用名为https 的简单https 入口点。

    【讨论】:

    • 好的,但如果我这样做,我将只有 https。那么我怎样才能描述这两种协议呢?
    • @Idez 谢谢。问题出在旧版本的 traefik 上。我已经用上一个版本测试过了,现在可以了。
    猜你喜欢
    • 2023-04-03
    • 1970-01-01
    • 2021-11-17
    • 1970-01-01
    • 2019-06-23
    • 2013-02-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多