influxdata / chronograf

Open source monitoring and visualization UI for the TICK stack
https://www.influxdata.com/time-series-platform/chronograf/
Other
1.51k stars 257 forks source link

is there a way to set up a proxy server for chronograf #845

Closed jacy closed 7 years ago

jacy commented 7 years ago

I have installed chronograph on my centos machine, and the default setting is applied which listen on localhost and port 8888, i set up a proxy sever to redirect url /chronograf to http://xx.xx.xx:8888, but it is not working as all the links seems using absolute path like 'http://xxxxx/chronograf.css'

goller commented 7 years ago

Hi @jacy thanks for writing in! Yup, we have that feature. @timraymond just added that into our 1.2.0-beta1 release here: #814 and #819

The bottom line is that you either use an env var BASE_PATH or -basepath CLI options. Base path is a URL path prefix under which all chronograf routes will be mounted.

So, I think you'll want to do --basepath /chronograf or BASE_PATH=/chronograf

Let me know if it works for you!

jacy commented 7 years ago

Hi @goller Thanks for your reply, my chronograf version is: Chronograf 1.2.0~beta1 (git: 2dbddaf84a03514471ac02d112bf4d63953bdfcf)

I have tried env setting(export BASE_PATH=chronograf) and CLI(/usr/bin/chronograf --host 0.0.0.0 --port 8888 -b /var/lib/chronograf/chronograf-v1.db -c /usr/share/chronograf/canned -basepath chronograf), but it seems not working, did I do it the wrong way?

goller commented 7 years ago

Hey @jacy, you did it just right. Would you put the chronograf logs into the issue? One thing we'll be able to see from the logs is if it is getting traffic or not.

Also, what URL are you using to get to the server? It should be http://server:8888/chronograf

jacy commented 7 years ago

@goller, after checked the log, it seems -basepath kinda override -b option, and it is now working using --basepath instead, thanks for your help, you saved my day.

goller commented 7 years ago

Great @jacy, well, we had -basepath in the README. I've updated it to double dash here: https://github.com/influxdata/chronograf/pull/849

I'm also going to edit what I wrote in this issue to make sure it says double dash so others in the future get the right advice.

jacy commented 7 years ago

@goller Nice, thanks.

I actually now have another problem:

Currently my setting is --basepath chronograf

And front end proxy mapping:

http://proxy.come/chronograf/ -> http://my.chronograf.server.com:8888/

With base path chronograf, the service is able to add the context path "chronograf" in the beginning of every js/css source url, for example:

Githubissues.
  • Githubissues is a development platform for aggregating issues.