earthobservations / wetterdienst

Open weather data for humans.
https://wetterdienst.readthedocs.io/
MIT License
349 stars 54 forks source link

Serve Wetterdienst Explorer at non-root URL #682

Closed amotl closed 1 year ago

amotl commented 2 years ago

Hi there,

while installing the Wetterdienst Explorer on the server, we found that it currently can not be served with an URL prefix.

We will probably have to add/adjust url_base_pathname at https://github.com/earthobservations/wetterdienst/blob/e77d121489db441897c39ec958273627fd1708d4/wetterdienst/ui/explorer/app.py#L30-L35

With kind regards, Andreas.

amotl commented 2 years ago

Apparently, we can also use DASH_URL_BASE_PATHNAME.

url_base_pathname

A local URL prefix to use app-wide. Default '/'. Both requests_pathname_prefix and routes_pathname_prefix default to url_base_pathname. env: DASH_URL_BASE_PATHNAME

-- https://dash.plotly.com/reference

amotl commented 2 years ago

It works like this:

export DASH_URL_BASE_PATHNAME=/explorer/
wetterdienst explorer --listen=localhost:8891

Nginx configuration, gist:

server {
  server_name wetterdienst.example.org;
  location ~ ^/explorer {
    proxy_set_header   Host $host;
    proxy_pass http://localhost:8891;
  }
}

I will leave this ticket open as a reminder to add a sentence about DASH_URL_BASE_PATHNAME to the documentation.

amotl commented 1 year ago

Hi again,

this will be fixed with 889f67c357, so I am closing the issue.

With kind regards, Andreas.