dosubot[bot] commented on issue #35712: URL: https://github.com/apache/superset/issues/35712#issuecomment-3414428251
<!-- Greeting --> Hi @dsuarez! I'm [Dosu](https://go.dosu.dev/dosubot) and Iām helping the superset team. <!-- Answer --> The redirect issue is likely caused by how Superset and your Nginx proxy handle protocol and port detection. Superset relies on headers like `X-Forwarded-Proto` and `X-Forwarded-Host` to construct URLs correctly when running behind a proxy. In your Nginx config, you are setting `X-Forwarded-Proto` twice (once as `$scheme` and once as `https`), which can result in ambiguous or incorrect values being passed to Superset, causing it to generate URLs with the wrong protocol and missing port. To fix this, set `X-Forwarded-Proto` only once, using `$scheme`, and ensure you also set `X-Forwarded-Port` to `$server_port`. For example: ```nginx proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Forwarded-Host $host; ``` Also, in Superset's config, enable proxy header support by setting `ENABLE_PROXY_FIX = True` and ensure `PROXY_FIX_CONFIG` trusts the necessary headers. This allows Superset to correctly interpret forwarded protocol, host, and port for URL generation and redirects ([source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/config.py)). Finally, confirm that your subpath configuration matches between Nginx and Superset (`SUPERSET_ROOT_APP` and `APPLICATION_ROOT`). Any mismatch can cause routing or redirect issues ([source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/app.py)). Making these changes should resolve the incorrect redirect behavior when adding a new dashboard behind your proxy setup. <!-- 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/c5098c27-cc7f-4db9-a193-e1baac699710?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/c5098c27-cc7f-4db9-a193-e1baac699710?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/c5098c27-cc7f-4db9-a193-e1baac699710?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/c5098c27-cc7f-4db9-a193-e1baac699710?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/c5098c27-cc7f-4db9-a193-e1baac699710?feedback_type=hallucination) | [Report š](https://app.dosu.dev/response-feedback/c5098c27-cc7f-4db9-a193-e1baac699710?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/c5098c27-cc7f-4db9-a193-e1baac699710?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]
