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

<!-- Greeting -->
Hi @vnk123! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the 
superset team.

<!-- Answer -->
Your issue is likely due to incomplete subpath configuration and known Superset 
bugs with subpath deployments. Here’s what you need to do:

1. In your superset_config.py, remove BASE_URL (it’s not used for subpath 
deployment). Instead, set:
   ```python
   ENABLE_PROXY_FIX = True
   SUPERSET_APP_ROOT = "/analytics"
   APPLICATION_ROOT = "/analytics"
   STATIC_ASSETS_PREFIX = "/analytics"
   ```
   (You can omit APPLICATION_ROOT and STATIC_ASSETS_PREFIX if you’re on a 
recent Superset version; they’ll be set automatically.)

2. In your Apache config, add:
   ```
   RequestHeader set X-Forwarded-Proto "https"
   RequestHeader set X-Forwarded-Prefix "/analytics"
   ```
   Make sure you do not strip or double the /analytics prefix in 
ProxyPass/ProxyPassReverse.

3. When starting Superset with gunicorn, ensure the environment variable 
SUPERSET_APP_ROOT is set, or use the Flask entrypoint:
   ```
   FLASK_APP="superset:create_app(superset_app_root='/analytics')"
   ```

4. Clear your browser cache after making these changes, as stale bootstrap data 
can cause broken links.

5. Be aware: subpath support in Superset is still BETA and buggy, especially in 
versions before 6.0.0. Some URLs (like /user_info, static assets, and 
WebSockets) may not work correctly under a subpath due to hardcoded paths. If 
you continue to see forbidden or 404 errors, check your Apache and Superset 
logs for missing prefix or static asset errors. If possible, consider using a 
subdomain (e.g., analytics.abc.test.io) instead, which is much more reliable 
for production use 
[[docs](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/docs/docs/configuration/configuring-superset.mdx)].

If you’re still stuck, please share your Superset version and the exact 
Gunicorn command/environment you use to launch Superset. This will help 
pinpoint any version-specific issues or missing config [[subpath 
issues](https://github.com/apache/superset/issues/35027)] [[subpath 
config](https://github.com/apache/superset/issues/34773)].


<!-- 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/91f94129-aec1-477b-9da9-741b522aabd0?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/91f94129-aec1-477b-9da9-741b522aabd0?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/91f94129-aec1-477b-9da9-741b522aabd0?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/91f94129-aec1-477b-9da9-741b522aabd0?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/91f94129-aec1-477b-9da9-741b522aabd0?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/91f94129-aec1-477b-9da9-741b522aabd0?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/91f94129-aec1-477b-9da9-741b522aabd0?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%20issue%20is%20likely%20due%20to%20incomplete%20subpath%20configuration%20and%20known%20Superset%20bugs%20with%20subpath%20deployments.%20Here%E2%80%99s%20what%20you%20need%20to%20do%3A%0A%0A1.%20In%20your%20superset_config.py%2C%20remove%20BASE_URL%20%28it%E2%80%99s%20not%20used%20for%20subpath%20deployment%29.%20Instead%2C%20set%3A%0A%20%20%20%60%60%60python%0A%20%20%20ENABLE_PROXY_FIX%20%3D%20True%0A%20%20%20SUPERSET_APP_ROOT%20%3D%20%22/analytics%22%0A%20%20%20APPLICATION_ROOT%20%3D%20%22/analytics%22%0A%20%20%20STATIC_ASSETS_PREFIX%20%3D%20%22/analytics%22%0A%20%20%20%60%60%60%0A%20%20%20%28You%20can%20omit%20APPLICATION_ROOT%20and%20STATIC_ASSETS_PREFIX%20if%20you%E2%80%99re%20on%20a%20recent%20Superset%20version%3B%20they%E2%80%99ll%20be%2
 
0set%20automatically.%29%0A%0A2.%20In%20your%20Apache%20config%2C%20add%3A%0A%20%20%20%60%60%60%0A%20%20%20RequestHeader%20set%20X-Forwarded-Proto%20%22https%22%0A%20%20%20RequestHeader%20set%20X-Forwarded-Prefix%20%22/analytics%22%0A%20%20%20%60%60%60%0A%20%20%20Make%20sure%20you%20do%20not%20strip%20or%20double%20the%20/analytics%20prefix%20in%20ProxyPass/ProxyPassReverse.%0A%0A3.%20When%20starting%20Superset%20with%20gunicorn%2C%20ensure%20the%20environment%20variable%20SUPERSET_APP_ROOT%20is%20set%2C%20or%20use%20the%20Flask%20entrypoint%3A%0A%20%20%20%60%60%60%0A%20%20%20FLASK_APP%3D%22superset%3Acreate_app%28superset_app_root%3D%27/analytics%27%29%22%0A%20%20%20%60%60%60%0A%0A4.%20Clear%20your%20browser%20cache%20after%20making%20these%20changes%2C%20as%20stale%20bootstrap%20data%20can%20cause%20broken%20links.%0A%0A5.%20Be%20aware%3A%20subpath%20support%20in%20Superset%20is%20still%20BETA%20and%20buggy%2C%20especially%20in%20versions%20before%206.0.0.%20Some%20URLs%20%28like%
 
20/user_info%2C%20static%20assets%2C%20and%20WebSockets%29%20may%20not%20work%20correctly%20under%20a%20subpath%20due%20to%20hardcoded%20paths.%20If%20you%20continue%20to%20see%20forbidden%20or%20404%20errors%2C%20check%20your%20Apache%20and%20Superset%20logs%20for%20missing%20prefix%20or%20static%20asset%20errors.%20If%20possible%2C%20consider%20using%20a%20subdomain%20%28e.g.%2C%20analytics.abc.test.io%29%20instead%2C%20which%20is%20much%20more%20reliable%20for%20production%20use%20%5B%5Bdocs%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/docs/docs/configuration/configuring-superset.mdx%29%5D.%0A%0AIf%20you%E2%80%99re%20still%20stuck%2C%20please%20share%20your%20Superset%20version%20and%20the%20exact%20Gunicorn%20command/environment%20you%20use%20to%20launch%20Superset.%20This%20will%20help%20pinpoint%20any%20version-specific%20issues%20or%20missing%20config%20%5B%5Bsubpath%20issues%5D%28https%3A//github.com/apache/superset/issues/35027%29%
 
5D%20%5B%5Bsubpath%20config%5D%28https%3A//github.com/apache/superset/issues/34773%29%5D.)&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.com/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-15195328

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