Skip to content
Advertisement

Nginx is throwing an 403 Forbidden on Static Files

I have a django app, python 2.7 with gunicorn and nginx.

Nginx is throwing a 403 Forbidden Error, if I try to view anything in my static folder @:

JavaScript

nginx config(/etc/nginx/sites-enabled/myapp) contains:

JavaScript

error.log contains:

JavaScript

access.log contains

JavaScript

I tried just viewing say a .css file in /static/ and it throws an error like this in source:

JavaScript

Advertisement

Answer

It appears the user nginx is running as (nginx?) is missing privileges to read the local file /home/ubuntu/virtualenv/myapp/myapp/homelaunch/static/img/templated/home/img.png. You probably wanna check file permissions as well as permissions on the directories in the hierarchy.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement