GitHub user gitsult4n added a comment to the discussion: Login redirection does 
not use subpath prefix

`SUPERSET_APP_ROOT` only mounts the app

The post login redirect is built from what Flask thinks the script root is so 
the proxy has to tell it

In `superset_config.py`

```python
ENABLE_PROXY_FIX = True
PROXY_FIX_CONFIG = {"x_for": 1, "x_proto": 1, "x_host": 1, "x_port": 1, 
"x_prefix": 1}
```

Then make Traefik send the prefix header

```yaml
- 
"traefik.http.middlewares.superset-prefix.headers.customrequestheaders.X-Forwarded-Prefix=/analytics"
- "traefik.http.routers.superset.middlewares=superset-prefix"
```

If you already use a `stripPrefix` middleware it sets `X-Forwarded-Prefix` for 
you and you should drop `SUPERSET_APP_ROOT` so the prefix is not applied twice

Pick one of the two models

- Traefik strips `/analytics` and Superset learns the prefix from the header
- Traefik keeps the path and `SUPERSET_APP_ROOT=/analytics` mounts it

Restart the container after the config change since this is read at app build 
time


GitHub link: 
https://github.com/apache/superset/discussions/40082#discussioncomment-18065585

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to