traefik + caddy>网关超时

时间:2017-08-27 21:46:30

标签: docker traefik caddy

我尝试在一个简单的容器中使用带有traefik的caddy服务器。 不幸的是,当我访问域名时,我收到SELECT * FROM ( SELECT id, CONCAT('c', '9') as target FROM cover) base WHERE target = "1" 错误。我无法理解错误是由于traefik还是我的容器造成的。

我的docker-compose文件:

Gateway Timeout

我的球童档案:

version: '2'
#
# [ server stack ]
#
services:
    web:
        image: abiosoft/caddy
        container_name: caddy
        restart: unless-stopped
        networks:
            - caddy_network
        ports:
            - 2015:2015
        volumes:
            # app
            - ./localhost:/srv
            # configs
            - ./config/Caddyfile:/etc/Caddyfile
        labels:
            - "traefik.frontend.rule=Host:domain.com"
            - "traefik.port=2015"
            - "traefik.backend=domain.com"
            - "traefik.frontend.entryPoints=http,https"
            - "traefik.enable=true"
#
# [ networks definition ]
#
networks:
    caddy_network:
            driver: bridge

有关信息,我们的加密证书完全由traefik生成。

有什么想法吗?这可能是端口配置的问题吗?

[编辑] traefik配置:

0.0.0.0:2015
browse
gzip
log stdout
errors stderr

提前感谢您的帮助。

jB表示

2 个答案:

答案 0 :(得分:0)

工作解决方案:

version: '2'
#
# [ server stack ]
#
services:
    web:
        image: abiosoft/caddy
        container_name: caddy
        restart: unless-stopped
        networks:
            - traefik_network
        ports:
            - 2015:2015
        volumes:
            # app
            - ./localhost:/srv
            # configs
            - ./config/Caddyfile:/etc/Caddyfile
        labels:
            - "traefik.frontend.rule=Host:domain.com"
            - "traefik.port=2015"
            - "traefik.backend=domain.com"
            - "traefik.frontend.entryPoints=http,https"
            - "traefik.enable=true"
            - "traefik.docker.network=traefik_network"
#
# [ networks definition ]
#
networks:
    traefik_network:
        external: true

答案 1 :(得分:0)

没有必要在该容器中打开端口,我的意思是这一行,这是不必要的,也不建议使用:  端口:     -2015:2015