Running InfluxDB API behind nginx (reverse proxy)

Hi I wonder if someone experience what I have experience when running influxdb behind nginx.
So here is the scenario:

I have influxdb instance running on my local machine, I want my machine’s firewall to only open on port 443 (https), so I set up a reverse proxy (nginx) so that it proxy the influxdb API which is running on port 8086.
All influx client should query data using that nginx (https//ipadd/db) not in https://ipadd:8086/query.
This is actually work’s fine, the client can get response from the nginx server, howevever this is what I experience.
When quering the data thru nginx, the response is slow (it almost took 3s) while getting the data thru the port 8086 (by passing the nginx), the response is almost in milleseconds only.
I don’t if it has something to do with my config on my nginx, so here what I have now:
image

Am I doing wrong with my configuration that is why it slows down the response?

Thank you.

Regards,
Henjoe

Hello @Henjoe_Gutierrez,
I think that your conclusion sounds right if without nginx the response is fast. I haven’t used nginx much so I don’t know. Perhaps you can try asking here?

Let me also tag @Jay_Clifford in case he knows.

1 Like

Hi @Henjoe_Gutierrez,
Yeah, I would check the nginx logs and see if they elude to any issues. I agree this might be an issue to post on their forums. If not hopefully one of our community users might see and pick this up.

Hi @Jay_Clifford
I think I already solve it. This sounds weird but by just changing the “localhost” to 127.0.0.1 solved the problem.

Thanks!

Regards,
Henjoe

2 Likes