我使用traefik作为cryptpad的反向代理。 Traefik正在一个码头工人的容器中运行。我使用此文档来解决此问题:https://github.com/xwiki-labs/cryptpad/wiki/Docker-(with-Nginx-and-Traefik)#configuring-traefik
这就是我的所作所为:
$ mkdir traefik && cd traefik
$ wget https://raw.githubusercontent.com/containous/traefik/master/traefik.sample.toml
$ mv traefik.sample.toml traefik.toml
$ touch acme.json && chmod 600 acme.json
我将此添加到traefik.toml
:
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[retry]
[acme]
email = "me@example.org"
storage = "acme.json"
entryPoint = "https"
onHostRule = true
[acme.httpChallenge]
entryPoint = "http"
创建docker-compose.yml
version: '3'
services:
traefik:
image: traefik
command: --docker
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik/traefik.toml:/traefik.toml
- ./traefik/acme.json:/acme.json
ports:
- 80:80
- 443:443
networks:
- proxy
container_name: traefik
networks:
proxy:
external: true
使用docker-compose up -dll创建/启动了traefik。
嗯 - 对于http它到目前为止工作正常 - 但我没有被重定向到https。如果我愿意,连接将被重置(https://cryptpad.mydomain.org - >连接被拒绝)。
我检查了是否正在侦听http / https:
tcp LISTEN 0 128 :::http :::*
tcp LISTEN 0 128 :::https :::*
并尝试远程登录:
[root@cryptpad ~]# telnet localhost 443
Trying ::1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.
我错过了什么?