I have been searching, asking AI and trying so many, many different things but I just absolutely cannot get a FastAPI proxy up and running.
I have the backend up and running 127.0.0.1:8000 (Uvicorn), I have the frontend up and running, static-ish page but every thing that I try causes nginx to not restart and then i roll back the change of the proxy template to default and nginx will start again but still no proxy on the web page.
I tried using the create-proxy-template.sh, that actually put it in the php-fpm folder instead of the proxy folder but anyways, that didn’t work either plus for some reason it put apache directives in the .tpl file.
Any kind of fairly straight forward type of instructions would be amazing! I honestly didn’t believe it should be that difficult to set up a FastAPI proxy, either it isn’t or I am just retarded…
Hi,
If i understood your problem correctly, Your problem might be related to Windows and Unix line endings. Unix/Linux (LF), Windows (CRLF). It will cause Nginx syntax errors.
Cleanest way, creating a dedicated Nginx proxy template. I use the exact same structure to deploy my Go (Golang) backend applications behind Nginx, and it works flawlessly.
Log into your server via SSH as root and navigate to the Hestia web templates directory:
cd /usr/local/hestia/data/templates/web/nginx nano FastAPI.tpl
Then Log into your Hestia Control Panel. Go to Web and edit your target domain. Under the Advanced Options, look for the Proxy Template dropdown menu. You should now see FastAPI listed there. Select it and Save.