I am using the default config while adding the specific directory with nginx installed on my ubuntu 12.04 machine.
server {
#listen 80; ## listen
I found a work around: Moved the folder to nginx configuration folder, in my case "/etc/nginx/my-web-app". And then changed the permissions to root user "sudo chown -R root:root "my-web-app".
You can also add which user will run the nginx. In the nginx.conf file, make the following changes:
user root;
You can add the above line as the first line in your nginx conf. You can write the name of any user who has the permission to write in that directory.
Change your nginx.conf
user
property to www-static
files owener.
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user your_user_name;
# same other config
On CentOS 7.0 I had this Access Deined
problem caused by SELinux and these steps resolved the issue:
yum install -y policycoreutils-devel
grep nginx /var/log/audit/audit.log | audit2allow -M nginx
semodule -i nginx.pp
Update: Just a side-note from what I've learned while using digitalocean's virtual Linux servers, or as they call them Droplets. Using SELinux requires a decent amount of RAM. It's most probably like you won't be able to run and manage SELinux on a droplet with less than 2GB of RAM.