starlette-admin icon indicating copy to clipboard operation
starlette-admin copied to clipboard

Bug: STATICS DONT WORK ON THE SERVER via coolify and custom nginx.conf

Open OzodbekUSTECH opened this issue 1 year ago • 3 comments

Describe the bug I am deploying fastapi project via coolify and docker. Everything works except for statics, as if nginx cant find statics. I tried different ways and found one solution, changed the src for statics in html files(../statics/etc)- like that. And finally it works, but i would like to get better way to solve it out.

Environment (please complete the following information):

  • starlette-admin==0.12.2
  • SQLAlchemy==2.0.20

OzodbekUSTECH avatar Dec 06 '23 16:12 OzodbekUSTECH

I mean, it doesn't look like a Starlette Admin issue. I'm using DO Droplet with Docker containers and it works great! WTYT @jowilf?

hasansezertasan avatar Dec 06 '23 23:12 hasansezertasan

I mean, it doesn't look like a Starlette Admin issue. I'm using DO Droplet with Docker containers and it works great! WTYT @jowilf?

I got an error, its about mixed content. I deployed project on the server via docker and nginx + coolify. And in links(html) there is http://domain. However my server has HTTPS://

How to get https:// by using request.url_for???

OzodbekUSTECH avatar Dec 07 '23 08:12 OzodbekUSTECH

Thank you, @hasansezertasan, for your help.

@OzodbekUSTECH, take a look at https://jowilf.github.io/starlette-admin/deployment/ and https://www.uvicorn.org/deployment/#running-behind-nginx

Related #143, #280

jowilf avatar Dec 07 '23 16:12 jowilf