1

Trying to setup Apache NiFi docker container, with traefik as load balancer over docker swarm network, We are able to access web UI, while browsing through UI, it redirects to docker internal host instead of proxy host name, As per below thread from Nifi here looks we need to pass http headers from proxy, couldn't find a way to set it through Traefik, any help here is much appreciated. On a side note tested Nifi with another reverse proxy, it works fine without any extra configurations needed.

1 Answers1

1

Adding below label in docker-compose for the service resolved the issue. traefik.frontend.headers.customRequestHeaders=X-ProxyScheme:https||X-ProxyHost:<Virtual HostName>||X-ProxyPort:<Virtual Port>

  • I have exactly the same problem. Behind Haproxy no prob, but doing the same behind Traefik results on redirects to docker internal host. So your solution should work also for me but I'm not adding properly your label to my docker-compose file. Please, can you help me to fix it? ` traefik.frontend.headers.customRequestHeaders=X-ProxyScheme: https traefik.frontend.headers.customRequestHeaders=X-ProxyHost: nifi-{{ env }}-{{ fqdn_base }} traefik.frontend.headers.customRequestHeaders=X-ProxyPort: 443 ` – Gonzalo Cao Oct 08 '18 at 14:39
  • Here is sample string I have added to docker backend service, under `deploy.labels` section: - "traefik.frontend.headers.customRequestHeaders=X-ProxyScheme:https||X-ProxyHost:nifi.demo.com||X-ProxyPort – Sachin Biradar Oct 08 '18 at 15:35
  • Thank you a lot @sachin-biradar. Finally found the appropiate notation for docker-comopse file version 3.3 traefik.frontend.headers.customRequestHeaders: "X-ProxyScheme:https||X-ProxyHost:nifi-host.demo.com" Now dealing with a new problem "No 'Access-Control-Allow-Origin' header is present on the requested resource" It didn't work even if I add a new label: traefik.frontend.headers.customResponseHeaders: "Access-Control-Allow-Origin: nifi-host.demo.com" – Gonzalo Cao Oct 08 '18 at 16:08