[Django]-Nginx raising 403 Forbidden when accessing Staticfiles in Django app on Digital Ocean

3👍

It looks like a permission issue. I ran into the same issue, and I fixed it by granting the right permissions to the static folder specified in settings.py and in nginx.conf.

Additionally, in nginx.conf, I edited the user line by adding my current username + my group.
Previously, I had: user nginx;
I changed it to: user <my_username> <group>.

You can get your username by running whoami in your terminal. You can use id -g -n $whoami to find your group.

Hope it helps.

👤Alpha

Leave a comment