https://prefect.io logo
Title
o

Ofir

05/02/2023, 5:20 PM
How do I run Prefect behind nginx? I have: https://www.my-site.com/app https://www.my-site.com/prefect And I need Prefect to rewrite the URL such that all assets (e.g. css, javascript, etc.) are rewritten with the
/prefect
prefix. Otherwise users will get a blank page when visiting /prefect, because the assets won’t be pointing to the right location. Does anyone have any experience with that? Should I set
PREFECT_UI_SERVE_BASE
env var? How should the Dockerfile for the agent change?
c

Christopher Boyd

05/15/2023, 8:10 PM
Hi Ofir, Are you trying to run Prefect cloud behind nginx as a proxy or?
Are you running Prefect server (OSS) and trying to front it with nginx?
That said, I think this is what you are looking for : https://www.digitalocean.com/community/tutorials/nginx-rewrite-url-rules Essentially you would want to rewrite whatever traffic is coming in on, to where you want it to go with the rewrite rule e.g. you can rewrite traffic from
/
to
/prefect
, or the other way around (redirect traffic from
/prefect
route to
/
)