Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-33413

SparkUI / Executor Page doesn't work where under external reverse proxy

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: In Progress
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.4.7, 3.0.1
    • Fix Version/s: None
    • Component/s: Web UI
    • Labels:
      None

      Description

      When using SparkUI under an external reverse proxy (NGinx, Træfik, ... ), you can configure SparkUI to be correctly displayed (html page and all static resources). But in the executors page, when calling the /api/, the URL don't use the Spark proxyBase configuration.

       

      Here is an example :

      I use Træfik to access to the SparkUI using the path : /sparkui (a proxy redirect is made when I call http://acme.com/sparkui to the SparkUI) and I use this Spark config : 

      spark.ui.proxyBase /sparkui
      spark.ui.proxyRedirectUri /

      using this config, when calling http://acme.com/sparkui I'll be redirected to http://acme.com/sparkui/jobs/ and all is currently serve (HTML and all static files)

       

      But I go on http://acme.com/sparkui/executors/ a XHR call is made using this URL http://acme.com/api/v1/applications so it doesn't use the reverse proxy rule ... the correct URL should be : http://acme.com/sparkui/api/v1/applications 

       

      I discover on the code (here for example https://github.com/apache/spark/blob/branch-3.0/core/src/main/resources/org/apache/spark/ui/static/utils.js#L193) that SparkUI use the location.origin (in my case http://acme.com). I think it should use the complete URL (under the last part like /executors/) instead or receive the proxyBase configuration to add it after the location.origin ... 

       

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Pierre Leresteux Pierre Leresteux
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: