php - 403 nginx error - permissions denied -


i getting 403 forbidden error when try access domain using nginx. nginx logs are:

[error] 13656#0: *4 "/var/www/example.com/www/index.php" forbidden (13: permission denied), client: 31.179.107.194, server: example.com, request: "get / http/1.1", host: "example.com" 

/var/www/ has recursive 777 permissions. sites-available config is:

#http serve # server {         listen   80;          root /var/www/example.com/www/;         index index.php index.html index.htm;          server_name example.com;          access_log /var/log/nginx/example.com.access.log combined buffer=1024k;         error_log /var/log/nginx/example.com.error.log;          client_max_body_size 128m;          if (!-e $request_filename) {                 rewrite ^/([a-za-z0-9]+)/([a-za-z0-9]+)/$ /index.php?controller=$1&action=$2 last;         }          location ~ \.php$ {                 if (!-f $document_root/$fastcgi_script_name){                         return 404;                 }                  fastcgi_split_path_info ^(.+\.php)(/.+)$;                 fastcgi_pass unix:/var/run/php5-fpm.sock;                 fastcgi_index index.php;                 proxy_connect_timeout 600s;                 proxy_read_timeout 600s;                 include fastcgi_params;         }          location ~ /\.ht {                 deny all;         } } 

nginx.conf contains user root; directive.

what's wrong?

one possible cause using selinux. see why nginx return 403 though permissions set properly?.

also, setting user root security risk , not recommended. using unprivileged user 'www-data' or `nobody' recommended, along permissions allow user access minimal amount of data necessary.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -