Chronograf: Reverse proxy broken with 1.7.3 drop in upgrade from 1.4.0

Created on 10 Dec 2018  Â·  3Comments  Â·  Source: influxdata/chronograf

Today we tried to upgrade Chronograf within our Docker-based TICK stack deployment to take advantage of some needed new features. We jumped from version 1.4.0 to 1.7.3. We made no changes elsewhere. As we understand it such an update to 1.7.3 should ‘just work.’ Our logs indicate the migration from 1.4.0 to 1.7.3 succeeded when we brought up the new Docker configuration.

Unfortunately, something is broken specifically with our reverse proxy setup. Without a reverse proxy between a browser and Chronograf (i.e. http://localhost:8888), things seems to work just fine. But with a reverse proxy we see nothing but 404 errors in the browser and level=info msg="Response: Not Found" component=server method=GET remote_addr="172.18.0.25:41350" response_time="46.137µs" status=404 entries in the Chronograf logs.

The Chronograf entry from our docker-compose.yml and a snippet from our Nginx config files are below. The only thing we modified in our files is the specified Docker image (1.4.0 → 1.7.3).

If we remove the reverse proxy setup and hit http://localhost:8888/chronograf/v1/sources we see well-formed JSON with values that we expect. With the reverse proxy setup in place and hitting the same url, we see the following: <!DOCTYPE html><html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <title>Chronograf</title> <link rel="shortcut icon" href="/chronograf//favicon.fa749080.ico"> <link rel="stylesheet" href="/chronograf//src.6adc4720.css"></head> <body> <div id="react-root" data-basepath="/chronograf/"></div> <script src="/chronograf//src.85d3bd0b.js"></script> </body> </html>%

What are we missing?

docker-compose.yml snippet

  chronograf:
    image: chronograf:1.7.3-alpine
    restart: on-failure
    environment:
      - BASE_PATH=/chronograf
      - PREFIX_ROUTES=true
      - PUBLIC_URL=http://example.xyz
    volumes:
      - ./data/chronograf:/var/lib/chronograf
    links:
      - influxdb
      - kapacitor

nginx.conf snippet

    location /chronograf/ {
      proxy_pass         http://chronograf:8888/;
      proxy_set_header   Host $host;
      proxy_set_header   X-Real-IP $remote_addr;
      proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
    }
stale

Most helpful comment

Update: Apparently, we needed to change our Nginx reverse proxy setup to include base path (below).

  proxy_pass         http://chronograf:8888/chronograf/;

Was this change to base path handling documented somewhere?

All 3 comments

Update: Apparently, we needed to change our Nginx reverse proxy setup to include base path (below).

  proxy_pass         http://chronograf:8888/chronograf/;

Was this change to base path handling documented somewhere?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue has been automatically closed because it has not had recent activity. Feel free to reopen if this issue is still important to you. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

121watts picture 121watts  Â·  6Comments

AlirieGray picture AlirieGray  Â·  4Comments

alexpaxton picture alexpaxton  Â·  6Comments

krysjoseoctanio picture krysjoseoctanio  Â·  4Comments

benschweizer picture benschweizer  Â·  5Comments