From 4fe59ac6ede4b5e0733ab99d4409e046026a7cec Mon Sep 17 00:00:00 2001 From: Daniel Goodman Date: Sat, 25 Nov 2017 20:33:15 +0200 Subject: [PATCH] nginx.conf changes to fix static files not working - fixing path for static files (avoid /app/static/static) - adding mime types so that css files are not returned as text/pain - added commented commands to enable logging --- etc/nginx.conf | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/etc/nginx.conf b/etc/nginx.conf index 6531582..8a5d3ea 100644 --- a/etc/nginx.conf +++ b/etc/nginx.conf @@ -1,6 +1,8 @@ worker_processes 1; daemon off; +# error_log /data/var/log/nginx/error.log; + events { worker_connections 1024; } @@ -19,6 +21,8 @@ http { application/x-javascript application/atom+xml; + # access_log /data/var/log/nginx/access.log; + # Proxy upstream to the gunicorn process upstream django { server 127.0.0.1:8000; @@ -31,8 +35,9 @@ http { listen 8080; # Settings to serve static files - location ^~ /static/ { - root /app/static/; + location /static/ { + root /app/; + include /data/etc/nginx/mime.types; } # Serve a static file (ex. favico)