GitHub user dosubot[bot] added a comment to the discussion: If using a reverse 
proxy and finally accessing it with a domain name, some pages would report 
errors when accessed

<!-- Answer -->
To address the "400 Bad Request" error you're encountering when accessing 
Superset through a reverse proxy with a domain name, you can try the following 
solutions:

1. **Ensure Correct Header Configuration**: Make sure your Nginx configuration 
is correctly setting the `X-Forwarded-Proto` header to reflect the scheme used 
by the client. This helps in generating accurate URLs in redirects. Update your 
Nginx configuration as follows:
   ```nginx
   proxy_set_header X-Forwarded-Proto $scheme;
   ```

2. **Enable Proxy Fix in Superset**: In your `superset_config.py`, enable the 
proxy fix to correctly interpret headers set by the reverse proxy. This is 
crucial for accurate URL generation in the 'Location' header:
   ```python
   ENABLE_PROXY_FIX = True
   PROXY_FIX_CONFIG = {"x_for": 1, "x_proto": 1, "x_host": 1, "x_port": 1, 
"x_prefix": 1}
   ```

3. **Check Redirect Configuration**: Ensure that the `Location` header in HTTP 
responses is correctly configured to use HTTPS. This can be managed by ensuring 
the `X-Forwarded-Proto` header is set correctly, as mentioned above.

These steps should help resolve the issue with incorrect redirects and the "400 
Bad Request" error when accessing Superset through a reverse proxy 
<sup>[[1]](https://github.com/apache/superset/discussions/32757)</sup><sup>[[2]](https://github.com/apache/superset/blob/master/superset/config.py)</sup>.


<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*

---
<sup>Help Dosu learn! Give it feedback: [Great 
Response](https://app.dosu.dev/response-feedback/c0747639-bad2-48e7-a271-27bfa115d03d?feedback_type=great_response)
 | [Irrelevant 
Answer](https://app.dosu.dev/response-feedback/c0747639-bad2-48e7-a271-27bfa115d03d?feedback_type=irrelevant_answer)
 | [Incorrect 
Sources](https://app.dosu.dev/response-feedback/c0747639-bad2-48e7-a271-27bfa115d03d?feedback_type=incorrect_sources)
 | [Too 
Verbose](https://app.dosu.dev/response-feedback/c0747639-bad2-48e7-a271-27bfa115d03d?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/c0747639-bad2-48e7-a271-27bfa115d03d?feedback_type=hallucination)
 | [Bug 
Report](https://app.dosu.dev/response-feedback/c0747639-bad2-48e7-a271-27bfa115d03d?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/c0747639-bad2-48e7-a271-27bfa115d03d?feedback_type=other)</sup>


GitHub link: 
https://github.com/apache/superset/discussions/33440#discussioncomment-13148269

----
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