如何在Traefik中代理WebSockets?

时间:2017-09-20 04:33:57

标签: websocket traefik upsource

我正在尝试将Upsource设置为在Traefik后面工作:https://www.jetbrains.com/help/upsource/proxy-configuration.html

traefik正在侦听端口8008和8443(因为80/443将用于另一个端口):

--entryPoints='Name:http Address::8008 Redirect.EntryPoint:https' --entryPoints='Name:https Address::8443 TLS'

码头标签:

labels:
  traefik.backend: upsource
  traefik.enable: "true"
  traefik.port: "8080"
  traefik.frontend.rule: "Host:review.domain.com"

conf/internal/bundle.properties中,base-url配置如下:

base-url=https\://review.domain.com\:8443/

问题:

time="2017-09-20T03:23:59Z" level=error msg="Error getting ACME certificates [review.domain.com] : Cannot obtain certificates map[review.domain.com:acme: Error 400 - urn:acme:error:connection - Connection refused
Error Detail:
        Validation for review.domain.com:443

为什么验证端口443而不是8443?

此外,要在Nginx中代理WebSockets:

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_pass http://upsourcemachine.domain.local:1111;
        proxy_pass_header Sec-Websocket-Extensions;

您能否确认Traefik支持WebSockets?如果是这样,如何配置?

2 个答案:

答案 0 :(得分:5)

Traefik处理websocket,您不需要任何特定的配置。

你的问题似乎更多地是关于Let's Encrypt中的挑战。 让我们的加密不会在默认的其他端口上处理TLS质询,而Traefik的默认挑战是TLS :(

因此,您需要将Traefik配置为使用DNS Challenge https://docs.traefik.io/configuration/acme/

答案 1 :(得分:0)

汇合的工作示例

WITH tt1 
     AS (SELECT Decode(id, '123', 1, 
                           2) order1, 
                id, 
                value1 
         FROM   tt), 
     tt2 
     AS (SELECT Min(order1) order1, 
                value1 
         FROM   tt1 
         GROUP  BY value1) 
SELECT tt1.id, 
       tt1.value1 
FROM   tt2, 
       tt1 
WHERE  tt1.value1 = tt2.value1 
       AND tt1.order1 = tt2.order1;