B
B
braindev2019-05-29 21:57:53
Nginx
braindev, 2019-05-29 21:57:53

Why directory of index nginx 403?

2019/05/29 14:32:50 [error] 252095#252095: *16510 directory index of "/var/www/www-root/data/www/subdomain.site.ru" is forbidden, client: IP, server : subdomain.site.ru, request: "GET / HTTP/1.1", host: "subdomain.site.ru, referrer: " http://subdomain.site.ru/ "

File permissions are 644, directories are 755 as recommended, the permissions and owner of files are www-root, /etc/nginx/nginx.conf user is www-root, error 403 when opening, current nginx config for subdomain, Isp panel is used manager
spoiler
server {
  server_name поддомен.сайт.ру www.поддомен.сайт.ру;
  charset off;
  index index.php index.html;
  disable_symlinks if_not_owner from=$root_path;
  include /etc/nginx/vhosts-includes/*.conf;
  include /etc/nginx/vhosts-resources/поддомен.сайт.ру/*.conf;
  access_log /var/www/httpd-logs/поддомен.сайт.ру.access.log;
  error_log /var/www/httpd-logs/поддомен.сайт.ру.error.log notice;
  ssi on;
  set $root_path /var/www/www-root/data/www/botadmin.сайт.ру/web;
  root $root_path;
  location / {
    	# Redirect everything that isn't a real file to index.php
        try_files $uri $uri/ /index.php$is_args$args;
    location ~ [^/]\.ph(p\d*|tml)$ {
      try_files /does_not_exists @php;
    }
    }
  location ~ \.php$ {
    fastcgi_index index.php;
    fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f [email protected]сайт.ру";
    fastcgi_pass unix:/var/www/php-fpm/www-root.sock;
    fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
    try_files $uri =404;
    include fastcgi_params;
  }
  set $root_path /var/www/www-root/data/www/поддомен.сайт.ру;
  listen айписервера:80;
  location @php {
    fastcgi_index index.php;
    fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f [email protected]поддомен.сайт.ру";
    fastcgi_pass unix:/var/www/php-fpm/www-root.sock;
    fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
    try_files $uri =404;
    include fastcgi_params;
  }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaliy, 2019-06-04
@omsknews

probably there is no index file, or it is not called as it says in the config)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question