0

I run python FASTapi web-app on the server using nginx and all works correctly excepting .css style.

When I open app on the server where I host it - all formattings are correct, but when I tried to open app from another PC I lose all formats.

I have following folders:

+---static
|   +---css
|   \---images
+---templates
|   +---admin
|   +---auth
|   \---user
app.py

And in the nginx config file, I have the following setup

location /static {
# path for static files
root "C:/robots/poc_app";
}

How to setup nginx for pick up .css file?

dmifer
  • 21
  • 4
  • Aren't you missing `/static` in your path for static files in your nginx configuration? i.e. it should point to the `static` directory inside your project? – MatsLindh Aug 23 '21 at 18:43
  • 1
    I have the ```root``` and ```/static``` and finally it will be concatenated as ```root/static``` (https://stackoverflow.com/questions/10631933/nginx-static-file-serving-confusion-with-root-alias) – dmifer Aug 24 '21 at 09:52

0 Answers0