GitHub user dosubot[bot] added a comment to the discussion: Launch Superset 
from existing sub domain

<!-- Answer -->
Your 404 error is caused by the Apache ProxyPass/ProxyPassReverse directives 
routing all traffic (/) to Superset, instead of only the /analytics/ subpath. 
Superset’s subpath middleware expects all requests to start with /analytics, 
and will return a 404 if they don’t. Here’s how to fix it:

- Change your Apache config so that ProxyPass and ProxyPassReverse only apply 
to /analytics/ (not /). For example:
  ```
  ProxyPass        /analytics/  http://127.0.0.1:8089/analytics/
  ProxyPassReverse /analytics/  http://127.0.0.1:8089/analytics/
  ```
  Make sure you remove or comment out any ProxyPass/ProxyPassReverse for / 
(root).

- Keep the RequestHeader set X-Forwarded-Prefix "/analytics" and 
ENABLE_PROXY_FIX = True in your Superset config.

- If static assets (like logos or JS) fail to load, add a ProxyPass for 
/analytics/static/ as well:
  ```
  ProxyPass        /analytics/static/  http://127.0.0.1:8089/analytics/static/
  ProxyPassReverse /analytics/static/  http://127.0.0.1:8089/analytics/static/
  ```

- Clear your browser cache after making these changes, as stale bootstrap data 
can cause routing issues.

- If you’re still seeing issues, check your Superset and Apache logs for 
requests missing the /analytics prefix or for static asset 404s. Also, confirm 
your Superset version: subpath support is only reliable in 6.0.0+ (with major 
improvements merged very recently [PR 
#35098](https://github.com/apache/superset/pull/35098)). Older versions have 
known bugs with subpath routing and static assets [[subpath 
issues](https://github.com/apache/superset/issues/35027)].

If possible, consider using a subdomain (like analytics.abc.test.io) instead of 
a subpath for a more robust setup 
[[discussion](https://github.com/apache/superset/discussions/31570)]. Let me 
know your Superset version and if these changes help!


<!-- 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/5b207ef0-7dd7-4b7c-ba93-4403d0799d73?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/5b207ef0-7dd7-4b7c-ba93-4403d0799d73?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/5b207ef0-7dd7-4b7c-ba93-4403d0799d73?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/5b207ef0-7dd7-4b7c-ba93-4403d0799d73?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/5b207ef0-7dd7-4b7c-ba93-4403d0799d73?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/5b207ef0-7dd7-4b7c-ba93-4403d0799d73?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/5b207ef0-7dd7-4b7c-ba93-4403d0799d73?feedback_type=other)</sup>

[![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=Your%20404%20error%20is%20caused%20by%20the%20Apache%20ProxyPass/ProxyPassReverse%20directives%20routing%20all%20traffic%20%28/%29%20to%20Superset%2C%20instead%20of%20only%20the%20/analytics/%20subpath.%20Superset%E2%80%99s%20subpath%20middleware%20expects%20all%20requests%20to%20start%20with%20/analytics%2C%20and%20will%20return%20a%20404%20if%20they%20don%E2%80%99t.%20Here%E2%80%99s%20how%20to%20fix%20it%3A%0A%0A-%20Change%20your%20Apache%20config%20so%20that%20ProxyPass%20and%20ProxyPassReverse%20only%20apply%20to%20/analytics/%20%28not%20/%29.%20For%20example%3A%0A%20%20%60%60%60%0A%20%20ProxyPass%20%20%20%20%20%20%20%20/analytics/%20%20http%3A//127.0.0.1%3A8089/analytics/%0A%20%20ProxyPassReverse%20/analytics/%20%20http%3A//127.0.0.1%3A8089/analy
 
tics/%0A%20%20%60%60%60%0A%20%20Make%20sure%20you%20remove%20or%20comment%20out%20any%20ProxyPass/ProxyPassReverse%20for%20/%20%28root%29.%0A%0A-%20Keep%20the%20RequestHeader%20set%20X-Forwarded-Prefix%20%22/analytics%22%20and%20ENABLE_PROXY_FIX%20%3D%20True%20in%20your%20Superset%20config.%0A%0A-%20If%20static%20assets%20%28like%20logos%20or%20JS%29%20fail%20to%20load%2C%20add%20a%20ProxyPass%20for%20/analytics/static/%20as%20well%3A%0A%20%20%60%60%60%0A%20%20ProxyPass%20%20%20%20%20%20%20%20/analytics/static/%20%20http%3A//127.0.0.1%3A8089/analytics/static/%0A%20%20ProxyPassReverse%20/analytics/static/%20%20http%3A//127.0.0.1%3A8089/analytics/static/%0A%20%20%60%60%60%0A%0A-%20Clear%20your%20browser%20cache%20after%20making%20these%20changes%2C%20as%20stale%20bootstrap%20data%20can%20cause%20routing%20issues.%0A%0A-%20If%20you%E2%80%99re%20still%20seeing%20issues%2C%20check%20your%20Superset%20and%20Apache%20logs%20for%20requests%20missing%20the%20/analytics%20prefix%20or%20for%20
 
static%20asset%20404s.%20Also%2C%20confirm%20your%20Superset%20version%3A%20subpath%20support%20is%20only%20reliable%20in%206.0.0%2B%20%28with%20major%20improvements%20merged%20very%20recently%20%5BPR%20%2335098%5D%28https%3A//github.com/apache/superset/pull/35098%29%29.%20Older%20versions%20have%20known%20bugs%20with%20subpath%20routing%20and%20static%20assets%20%5B%5Bsubpath%20issues%5D%28https%3A//github.com/apache/superset/issues/35027%29%5D.%0A%0AIf%20possible%2C%20consider%20using%20a%20subdomain%20%28like%20analytics.abc.test.io%29%20instead%20of%20a%20subpath%20for%20a%20more%20robust%20setup%20%5B%5Bdiscussion%5D%28https%3A//github.com/apache/superset/discussions/31570%29%5D.%20Let%20me%20know%20your%20Superset%20version%20and%20if%20these%20changes%20help%21)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on X](https://img.shields.io/badge/X-share-black)](https://twitter.co
 
m/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/36453)

GitHub link: 
https://github.com/apache/superset/discussions/36453#discussioncomment-15205032

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