dosubot[bot] commented on issue #35712:
URL: https://github.com/apache/superset/issues/35712#issuecomment-3430898173
<!-- Answer -->
The redirect issue when creating a new dashboard behind your Nginx proxy and
subpath setup is likely due to missing proxy headers and incomplete Superset
config. Superset expects headers like `X-Forwarded-Prefix` or `X-Script-Name`
to correctly handle subpath deployments. Without these, Flask's `url_for` (used
for dashboard creation redirects) may generate URLs missing the protocol, port,
or subpath—even if other features work fine.
Try adding this to your Nginx config inside the location block:
```nginx
proxy_set_header X-Forwarded-Prefix /apps/superset;
```
or
```nginx
proxy_set_header X-Script-Name /apps/superset;
```
(choose one, not both—`X-Forwarded-Prefix` is preferred in recent Superset
versions)
Then, in your Superset config, set:
```python
ENABLE_PROXY_FIX = True
PROXY_FIX_CONFIG = {"x_for": 1, "x_proto": 1, "x_host": 1, "x_port": 1,
"x_prefix": 1}
PREFERRED_URL_SCHEME = "https"
```
This ensures Superset trusts all relevant proxy headers and uses HTTPS for
redirects. Your environment variables for subpath (`SUPERSET_APP_ROOT`,
`APPLICATION_ROOT`, `STATIC_ASSETS_PREFIX`) look correct.
Recent discussions and code confirm that missing these headers is a common
cause of redirect issues in subpath deployments, especially for dashboard
creation and similar actions that rely on backend redirects. Superset's subpath
support is still considered BETA, so some features may not fully respect the
subpath, but these settings resolve most redirect problems in master/latest-dev
([source](https://github.com/apache/superset/issues/34773),
[source](https://github.com/apache/superset/discussions/33229),
[source](https://github.com/apache/superset/issues/33228)).
After updating your Nginx and Superset config, restart both services and
test the dashboard creation flow again. If the issue persists, check your
Superset logs for any errors related to proxy headers or subpath handling.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
---
<sup>How did I do?
[Good](https://app.dosu.dev/response-feedback/4e2a78fc-387a-4376-a78a-a65804f5bda2?feedback_type=great_response)
|
[Irrelevant](https://app.dosu.dev/response-feedback/4e2a78fc-387a-4376-a78a-a65804f5bda2?feedback_type=irrelevant_answer)
|
[Incorrect](https://app.dosu.dev/response-feedback/4e2a78fc-387a-4376-a78a-a65804f5bda2?feedback_type=incorrect_sources)
|
[Verbose](https://app.dosu.dev/response-feedback/4e2a78fc-387a-4376-a78a-a65804f5bda2?feedback_type=too_verbose)
|
[Hallucination](https://app.dosu.dev/response-feedback/4e2a78fc-387a-4376-a78a-a65804f5bda2?feedback_type=hallucination)
| [Report
🐛](https://app.dosu.dev/response-feedback/4e2a78fc-387a-4376-a78a-a65804f5bda2?feedback_type=bug_report)
|
[Other](https://app.dosu.dev/response-feedback/4e2a78fc-387a-4376-a78a-a65804f5bda2?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu
b) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/35712)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]