简体   繁体   中英

Apache Nifi behind Traefik as a reverse proxy

I'm using Traefik as a reverse proxy for a lot of services and for tls termination. This works properly excepted Nifi. When trying to forward incomming requests to Nifi I get "Bad Gateway" responses. Does anybody have an idea how to fix that?

Thanks a lot:-)

traefik:
image: "traefik:v2.2"
container_name: "traefik"
restart: always
networks: 
  - monitoring
  - website
  - iot
command:
  #- "--log.level=DEBUG"
  - "--api.insecure=true"
  - "--providers.docker=true"
  - "--providers.docker.exposedbydefault=false"
  - "--entrypoints.web.address=:80"
  - "--entrypoints.websecure.address=:443"
  - "--certificatesresolvers.myresolver.acme.httpchallenge=true"
  - "--certificatesresolvers.myresolver.acme.httpchallenge.entrypoint=web"
  #s- "--certificatesresolvers.myresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
  - "--certificatesresolvers.myresolver.acme.email=test@test.de"
  - "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
  # prom metrics
  - "--metrics.prometheus=true"
---
nifi:
image: apache/nifi:latest
container_name: nifi
restart: on-failure
environment: 
  - NIFI_WEB_PROXY_CONTEXT_PATH=/
  - NIFI_WEB_HTTP_PORT= 8080
expose:
  - 8080
networks: 
  - iot
labels:
  - "traefik.enable=true"
  - "traefik.http.routers.nifi.rule=Host(`nifi.example.de`)"
  - "traefik.http.routers.nifi.entrypoints=web"

  - "traefik.http.routers.nifi.middlewares=nifi-auth"
  # Basic Auth
  - "traefik.http.middlewares.nifi-auth.basicauth.users=admin:$$xyz$$xyz$$xyz"

Any idea?? :-)

Since there are several ports open for the ui etc. it's required to define the routing port by using (eg):

 - "traefik.http.services.nifi.loadbalancer.server.port=8080"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM