You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gradio==4.27.0
fastapi==0.110.2
uvicorn==0.29.0
nginx version: nginx/1.24.0
built by gcc 11.2.0 (Ubuntu 11.2.0-19ubuntu1)
built with OpenSSL 3.0.2 15 Mar 2022
Severity
I can work around it
The text was updated successfully, but these errors were encountered:
Similar issue, after setting root_path to uvicorn, mounting the gradio app in fastapi shows 404 error. The same error still occurs when the front-end uses the Vite proxy.
from fastapi import FastAPI
import gradio as gr
import uvicorn
app = FastAPI()
def greet(name):
return "Hello " + name + "!"
gradio_app = gr.Interface(fn=greet, inputs="text", outputs="text")
gr.mount_gradio_app(app, gradio_app, path="/gradio")
if __name__ == "__main__":
uvicorn.run('app:app', host="0.0.0.0", port=8000, root_path='/dev-api')
I think this issue seems to be related to the bug mentioned in this PR(tiangolo/fastapi#11160).
Describe the bug
I use https connection and BASIC authentication to securely so many ai apps.
https://fastapi.example.com:18000/gradio
is accessed by the nginx proxy to
http://127.0.0.1:8000/gradio
is called.
http://127.0.0.1:8000/
is fastapi and gradio is mounted on /gradio.
For example, a connection that should access /gradio/info becomes /info and returns a 404 error.
Have you searched existing issues? 🔎
Reproduction
nginx.conf
main.py
app.py
Temporary workaround
Screenshot
Logs
No response
System Info
Severity
I can work around it
The text was updated successfully, but these errors were encountered: