gradio: Gradio static files do not follow the root_path behind a Jupyter proxy on k8s

Describe the bug

Hi everyone,

I am experiencing a problem when running Gradio 4.16.0 behind a Jupyter proxy on a k8s cluster specifying a root_path, static files do not follow this path and my browser console returns a 404 error.

Below is the code:

demo.launch(
    server_port=5300, 
    root_path="/proxy/absolute/5300/", 
    share=True, 
    inline=False
)

The link is still accessible and the components can be viewed without style.

Thank you in advance, I remain at your disposal for any clarification.

Best regards, Louis

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr

def greet(name):
    return "Hello " + name + "!"

demo = gr.Interface(
    fn=greet, 
    inputs="text", 
    outputs="text"
)

demo.launch(
    server_port=5300, 
    root_path="/proxy/absolute/5300/", 
    share=True, 
    inline=False
)

Screenshot

No response

Logs

No response

System Info

gradio==4.16.0 on Python 3.9

Severity

Blocking usage of gradio

About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Comments: 18 (11 by maintainers)

Commits related to this issue

Most upvoted comments

@abidlabs Magnificent! That’s a job well done (and I can upgrade to latest Gradio soon). Below is the same app as screenshot like before (but working this time). Thank you very much! image

@abidlabs - Any updates? Currently i need to stay on 4.16. The error came with 4.18.

Ok reopening this issue and looking into it!