vadym-serdiuk opened a new issue, #26319:
URL: https://github.com/apache/superset/issues/26319

   ## [SIP] Allow to deploy Superset under the prefix of an URL
   
   ### Motivation
   
   We faced a problem in the deployment of the Superset under the prefix like 
https://{domain}/superset. We can not use subdomains.
   Configuring a gateway (like nginx) didn't work since there were problems 
with redirects. After a lot of efforts we decided to refactor the Superset. 
Furthermore, we saw many requests and questions about how to deploy Superset 
under the prefix without any working solutions.
   
   ### Proposed Change
   
   I refactored a backend code by replacing simple string urls with the 
`url_for` function on the backend, or with the APPLICATION_ROOT variable in 
places with no app context. I added a function `withPrefix` on the frontend and 
use it for all the urls, generated on the frontend. 
   
   ### New or Changed Public Interfaces
   
   There are no changes in the public interfaces
   
   ### New dependencies
   
   No new dependencies
   
   ### Migration Plan and Compatibility
   
   No migrations
   
   ### Rejected Alternatives
   
   Configuration of gateways is not enough.
   
   
   ### Configuration
   
   To use deployment with the prefix you just need to add the following 
variables into the Superset config
   
   ```python
   ENABLE_PROXY_FIX = True
   STATIC_ASSETS_PREFIX = "/superset"
   APPLICATION_ROOT = "/superset"
   ```
   and to configure the gateway with this minimal configuration (nginx syntax) 
   
   ```nginx
   location /superset/ {
       proxy_pass         http://{superset_host}:{superset_port}/;
       proxy_set_header   X-Forwarded-Prefix /superset/;
   }
   ```
   Be noticed that the trailing slashes are important for the nginx 
configuration
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to