When configuring the app behind Nginx, the theme.css file accessed in the browser does not include the port number. This results in abnormal UI loading.
It seems the bug of missing subpaths has been fixed earlier.
Possible workaround
Following this suggestion, I tried setting proxy_set_header Host $http_host;. Unfortunately, this only enabled version 4.20.1 to work as expected, not versions 4.21.0 or 4.37.2. However, changing both instances of $host to $http_host appeared to resolve the issue, like this:
I'm not certain if this is the correct fix, but it worked for me. It might be helpful to update the guide with a proper configuration to save others' time. Thank you for your attention!
Have you searched existing issues? š
[X] I have searched and found no existing issues
Reproduction
Gradio app
import gradio as gr
import time
def test(x):
time.sleep(1)
return x
gr.Interface(test, "textbox", "textbox").queue().launch()
Describe the bug
Description
When configuring the app behind Nginx, the
theme.css
file accessed in the browser does not include the port number. This results in abnormal UI loading.Possible workaround
Following this suggestion, I tried setting
proxy_set_header Host $http_host;
. Unfortunately, this only enabled version 4.20.1 to work as expected, not versions 4.21.0 or 4.37.2. However, changing both instances of$host
to$http_host
appeared to resolve the issue, like this:I'm not certain if this is the correct fix, but it worked for me. It might be helpful to update the guide with a proper configuration to save others' time. Thank you for your attention!
Have you searched existing issues? š
Reproduction
Gradio app
Nginx config
The script is adapted from the guide.
Screenshot
No response
Logs
No response
System Info
Severity
I can work around it