FastAPI + Reflex and NGINX in a production environment #4844
-
I am using Reflex to develop a frontend application for a FastAPI app. The reason I am doing this is because the frontend will be part of larger fastapi project. I want to gradually move the existing frontend to reflex. The reflex app is sending requests to the fastapi backend via HTTPX. I am exporting the frontend created with the reflex with the reflex export command to the directory .web/_static/ On my local dev environment, everything works OK, but I am having trouble deploying the reflex backend in nginx. My reflex backend is working, as shown here: Here is my nginx configuration. The HTTP traffic is for the fastapi application: The websocket connects successfully: But I get these errors in nginx:
I cannot login for example – the following error is shown in my front end application: This login for example works OK on my local dev env. I am inclined to think I have not configured nginx correctly? Any ideas are welcome. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I have tried deleting this question. Please ignore it. I had not set up the fastapi url correctly hence the "Connection Refused" error. |
Beta Was this translation helpful? Give feedback.
I have tried deleting this question. Please ignore it.
I had not set up the fastapi url correctly hence the "Connection Refused" error.