Hi,

A while back I wanted to revive the discussion on deploying Superset under a 
path prefix: https://github.com/apache/superset/issues/26319.

After a little more time than I would have liked I have a working 
implementation at https://github.com/apache/superset/pull/30134 that I’m fairly 
happy with and I’m just nursing some PR checks through.

The approach I have taken is to add some middleware in 
superset.app:create_app<https://github.com/apache/superset/pull/30134/files#diff-9689cb75a0ebe47604d59e0a54c904040cd60b45a283a87d0f8d77cac60751d8>
 that translates the paths that have a prefix into un-prefixed paths for the 
remainder of the application. This is similar to how Flask recommends deploying 
apps that need to run in the same process but on different paths.

For the frontend I have passed the application root through the 
bootstrap_data<https://github.com/apache/superset/pull/30134/files#diff-8a676fb002920d1d142fa9b19ded1ecb7b8b8d682cf9b9fe80f01b1a2314c86dR336>
 and used this to prefix paths as necessary across the frontend. This has the 
advantage of not requiring a separate webpack build of the frontend assets for 
each new prefix.

Does this sound like a reasonable approach?

Best,

Martyn

ISIS Computing Division
Science and Technology Facilities Council

Reply via email to