【发布时间】:2021-05-22 15:20:01
【问题描述】:
我需要帮助,
我尝试了很长时间,但我没有设法用 Traefik 设置 Nginx。 码头工人撰写:
services:
traefik:
image: traefik:latest
container_name: traefik
restart: unless-stopped
security_opt:
- no-new-privileges:true
networks:
- proxy
ports:
- 80:80
- 443:443
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./data/traefik.yml:/traefik.yml:ro
- ./data/acme.json:/acme.json
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.entrypoints=http"
- "traefik.http.routers.traefik.rule=Host(`blockworldhd.net`)"
- "traefik.http.middlewares.traefik-auth.basicauth.users=jan:3065jAnjAn"
- "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.traefik.middlewares=traefik-https-redirect"
- "traefik.http.routers.traefik-secure.entrypoints=https"
- "traefik.http.routers.traefik-secure.rule=Host(`blockworldhd.net`)"
- "traefik.http.routers.traefik-secure.middlewares=traefik-auth"
- "traefik.http.routers.traefik-secure.tls=true"
- "traefik.http.routers.traefik-secure.tls.certresolver=http"
- "traefik.http.routers.traefik-secure.service=api@internal"
Nginx:
image: nginx:latest
container_name: web
labels:
- traefik.backend=Nginx-Pro
- traefik.frontend.passHostHeader
- traefik.frontend.rule=Host:webkonferenz.blockworldhd.net
- traefik.docker.network=proxy
- "traefik.port=80"
- "traefik.frontend.entryPoints=http"
networks:
- proxy
volumes:
- /var/www/nginx-pro/:/var/www/
- /etc/nginx/nginx-pro/:/etc/nginx
proxy:
external: true
每次我尝试访问网站时都会出现:404 page not found
我能做什么?
感谢您的帮助!
一月
【问题讨论】:
标签: docker nginx web webserver traefik