Why not rights for nginx?

Simple config
server {
 listen 80;
 server_name somesite.ru www.somesite.ru;

 root /home/admin/web/somesite.EN/www/;
 index index.php;

 location ~* \.(jpg|css|png|js|ico|html)$ {
 access_log off;
 expires max;
 log_not_found off;
}

 location / {
 set $somesite_path /home/admin/web/somesite.ru/www;
 location 127.0.0.1:9000;
 fastcgi_index index.php;
 include fastcgi_params;
 fastcgi_param SCRIPT_FILENAME $somesite_path$fastcgi_script_name;
 fastcgi_param DOCUMENT_ROOT $root_path;
}
}

When you try to go on somesite.ru returns a 403 error, no access.

added logging
access_log /home/admin/web/somesite.ru/log/access.log combined;
error_log /home/admin/web/somesite.ru/log/error.log debug;

and when you run a nginx writes:
nginx[21989]: nginx: [emerg] open() "/home/admin/web/somesite.ru/log/access.log" failed (13: Permission denied)

The user nginx is a default nginx.
The folder is /home/admin/ owner admin:admin.
Added the user nginx to the group admin.

What am I doing wrong, please tell me?
March 19th 20 at 09:02
1 answer
March 19th 20 at 09:04
You log file is not created. Make as usual:

access_log /var/log/nginx/somesite.access.log;
error_log /var/log/nginx/somesite.error.log;


And in the console
mkdir -p /var/log/nginx; chown nginx: var/log/nginx
When you try to go on somesite.ru returns a 403 error, no access.
The essence of the question is a little different :) - Mercedes86 commented on March 19th 20 at 09:07
what chown www-data

the person nginx runs under nginx user - Frederic_Trembl commented on March 19th 20 at 09:10
@Frederic_Trembland Soren overlooked. - Nicolas2 commented on March 19th 20 at 09:13

Find more questions by tags Nginx