jeanpommier commented on PR #30134:
URL: https://github.com/apache/superset/pull/30134#issuecomment-2573172590

   Hello ! Happy new year !
   
   > This is fine when there is no url prefix set as the paths that both the 
reverse proxy and the superset app see are the same. When there is a url prefix 
set it is baked into the javascript files that webpack builds and when 
accessing the superset app directly the extra prefix part of the path raises an 
error in the superset app and the screenshot generation fails.
   
   Well, I might have a solution for this one. I didn't get the time to look at 
the image generation task you proposed, but I was rather investigating around 
the path prefix topic. My concern was to avoid relying on a reverse-proxy for 
the path-prefix thing. IMO, it makes things complicated. For instance the issue 
you met above: dev setup (without docker compo) and prod-like setup with a 
reverse proxy works differently, with a different frontend where the path is 
hard-coded.
   Looking on the backend side of it, my first idea was that we maybe didn't 
use the Flask blueprints to their full extent, but it turns out this would not 
be that easy to adapt to our needs. And maybe not a clean solution.
   
   ***But***, I stumbled across [this blog 
post](https://dlukes.github.io/flask-wsgi-url-prefix.html) where I discovered 
that WSGI protocol supports a parameter that sets such a path prefix, and that 
is handled on the WSGI side of it (e.g. gunicorn). I tested it (on top of your 
PR since we need the url_for links) and it works like a charm.
   
   **What does it change ?**
   
   Supposing you choose `analytics` as the path prefix, the backend is accessed 
on http://superset_app:8088/analytics/. and the reverse-proxy has a much 
simpler job of just routing /analytics to http://superset_app:8088/analytics/. 
   On your above-mentioned issue, this means that the paths will concord 
between the front and back end, so it should work without even needing the 
WEBDRIVER_BASEURL fix you propose.
   
   I'm still quite uncomfortable at the necessity to build the frontend to 
support a path other than root. I haven't made experiments yet on this, but 
wouldn't it be conceivable that the frontend looks for a config instruction 
from the backend to get this information ?


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