You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m trying to host the application under a subdirectory, specifically https://example.com/flagsmith-frontend, and I’ve followed the documentation for setting the BASE_URL environment variable. Here’s what I’ve attempted so far:
BASE_URL values tried: /flagsmith-frontend or https://example.com/flagsmith-frontend.
Expected behavior: Routes should work with the /flagsmith-frontendhttps://example.com/flagsmith-frontend subdirectory automatically prefixed, allowing the application to function seamlessly.
Actual behavior: Routes and assets fail to load correctly when accessed via this subdirectory, regardless of BASE_URL settings.
I also tried ASSET_URL, it does not work, either.
It seems that BASE_URL may not fully account for hosting in a subdirectory environment. Any guidance on achieving this configuration, or confirmation if this is a limitation, would be greatly appreciated!
set BASE_URL environment variable to /flagsmith-frontend
Go to https://example.com/flagsmith-frontend
Got error page, screenshots is below
Expected behavior
Routes should work with the /flagsmith-frontendhttps://example.com/flagsmith-frontend subdirectory automatically prefixed, allowing the application to function seamlessly.
Screenshots
The text was updated successfully, but these errors were encountered:
@Bear1110 can you confirm if you're running the API and frontend separately or not? i.e. what is the value of api.separateApiAndFrontend in your chart values?
Hi @matthewelwell, the default value of api.separateApiAndFrontend is true. Based on my understanding, the YAML I posted was generated with this default value in mind.
I consulted a friend who is knowledgeable about frontend technologies, and he mentioned that the BASE_URL value is primarily used by the frontend framework (e.g., Next.js) during the build process, rather than for deployment purposes. However, I’m not entirely sure if this perspective is accurate.
What do you think? Could you clarify if this interpretation is correct?
I don't think there's a straight forward approach to this from a frontend perspective, various paths to static resources are absolute e.g. /static/logo.png since the single page app could be rendering from any URL e.g. / and /environments/:sub-page/. Webpack wouldn't reliably be able to compile these down to use a specified url. Setting up some form of redirects may work however.
How are you running Flagsmith
Describe the bug
I’m trying to host the application under a subdirectory, specifically
https://example.com/flagsmith-frontend
, and I’ve followed the documentation for setting the BASE_URL environment variable. Here’s what I’ve attempted so far:BASE_URL values tried:
/flagsmith-frontend
orhttps://example.com/flagsmith-frontend
.Expected behavior: Routes should work with the
/flagsmith-frontend
https://example.com/flagsmith-frontend subdirectory automatically prefixed, allowing the application to function seamlessly.Actual behavior: Routes and assets fail to load correctly when accessed via this subdirectory, regardless of BASE_URL settings.
I also tried
ASSET_URL
, it does not work, either.It seems that BASE_URL may not fully account for hosting in a subdirectory environment. Any guidance on achieving this configuration, or confirmation if this is a limitation, would be greatly appreciated!
Thank you for your help!
this is my deployment yaml which is generated from helm by https://github.com/Flagsmith/flagsmith-charts (( manually edit
BASE_URL
andASSET_URL
Steps To Reproduce
BASE_URL
environment variable to/flagsmith-frontend
https://example.com/flagsmith-frontend
Expected behavior
Routes should work with the
/flagsmith-frontend
https://example.com/flagsmith-frontend subdirectory automatically prefixed, allowing the application to function seamlessly.Screenshots
The text was updated successfully, but these errors were encountered: