How to use influx client with apache reverse proxy and ssl

Dear all - this is my first post here - exiting! I installed InfluxDB on a web server, to put measurements into it later.

I can run the “influx” client successfully on the servers CLI. Then I set up a user and a pasword and succeeded also to use “influx” from a different pc in my home network like

$ influx -host "ahost" -username "auser" -password "apassword".

Since I want to store and display the data on a this web server with HTTPS / letsencrypt, I went next step and installed grafana on the machine and set a reverse proxy, so I can reach grafana via https://myserverdomain/grafana. Apache’s ssl config needs to have like

ProxyPass "/grafana" "http://localhost:3000"

for this and adjusting grafana.ini.

Since influxDB has no visible web frontend (I guess?) I wonder how I can test my setup for it:

ProxyPass /influx http://localhost:8086/

From the Internet I got a tip with curl:

$ curl -sL -I l https://myserver.no-ip.biz/influx/ping

this gives me back a success (204) as I learned:

HTTP/1.1 204 No Content
Date: Sat, 14 Nov 2020 18:33:46 GMT
Server: Apache
X-XSS-Protection: 1; mode=block
x-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000; includeSubDomains
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *
Referrer-Policy: strict-origin
Content-Type: application/json
Request-Id: ee8f37ea-26a7-11eb-800a-bc5ff4abbd9d
X-Influxdb-Build: OSS
X-Influxdb-Version: 1.8.3
X-Request-Id: ee8f37ea-26a7-11eb-800a-bc5ff4abbd9d

So my questions are: From the internet, (how) can I run a command line with “influx …” and access the database as I would locally in my LAN?

And how to feed data from node-red into it? When I tried, it says (debug output of the influxDB node:)

Error: A 301 Moved Permanently error occurred: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://myserver.no-ip.biz/influx:443/write?db=mydb&amp;p=apassword&amp;precision=n&amp;rp=&amp;u=auser">here</a>.</p>
</body></html>

Thanks in advance!

Hello @loeten,
Welcome! InfluxDB has a visible web frontend for 2.x https://docs.influxdata.com/influxdb/v2.0/visualize-data/ 8086
and for 1.x
https://docs.influxdata.com/chronograf/v1.8/ 8888

Influxdb 2.0 does indeed have a frontend which I can view at localhost…

How can it be seen reverse proxied through apache though? With chronograf the base_path variable is set, but I cannot for the life of me get this to work for InfluxDb 2.0 OSS. I am left with a blank browser screen on every attempt.

1 Like

I have the same problem… When I set up the reverse proxy I end up on a blanket site

I gave up on trying 2 months ago. I reverted to version 1.8.x, which is unfortunate. I was a bit surprised that no on else said anything, because surely others are running on something other than localhost. If you have any luck, please update me.

About the influx connection, I used curl (instead of the NodeRed node) from the remote location to see what happens, and also to update - never used any graphic frontend.

About the reverse proxy issues (also with Grafana) I found that it disliked some security headers, that were delivered by default by my web server. After disabling it and step by step enabling it back, I was able to identify the problematic one and have an influx and grafana (docker) running on reverse proxy and apache2 as planned originally.