Hi, i also want to run influxdb2 behind traefik. I also want to use the TLS Certificate, which i have created with lets encrypt. This already works for my other containers. I have set a DNS name in pihole and want to access influxdb with this name. But because some Services in my network need to adress a port for influxdb, i want wo ask, if it is possible to redirect the traffic from port 8086 to tls enableds 8086 and adress the hostname with the port.
E.g.
Before i have used traefik, i adressed my influxdb2 via its ip
Now i would like to adress the server, like any other container in my network via its domain name which have set in pihole. Works for any other container, but not for influxdb because here i need a port.
Hi @danyo2008
The trick is to remove the self-signed and rely entirely on Traefik.
To do this, you have to modify your InfluxDB config.yml file as follows:
tls-cert: ""
tls-key: ""
Also, I don't think you need the TCP routers tbh. I still have mine but that's because I haven't had the chance to modify the docker-compose to comment them out. I think you only need the http router for 8086.
thanks for your answer.... HTTPS itself works fine with letsencrypt. Even locally on my network.
But i have a service, which will connect to the influxdb via influx.example.com and have also an obligatory field for the port. So the adress schould be https://influx.example.com:8086.
So, https shall not run on port 443 but on 8086..... Hope, you can understand my problem
To have it work on 8086, you need a new entry point listening on 8086 in Traefik itself and use the same lets encrypt certificate provider. Make sure you specify the new entry point in your config.
In the example I provided above, you would have the first line use "ep-influxdb" instead of "secureweb"