samedi 22 mai 2021

How to setup Nginx with Traefik

I need help,

I tried it a long time but I didn't manage to setup Nginx with Traefik. Docker-compose:


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 

Every time when I try to go on the website there is: 404 page not found

What can I do?

Thanks for help!

Jan




Aucun commentaire:

Enregistrer un commentaire