Y
Y
yeszhanov2017-02-12 21:42:58
Nginx
yeszhanov, 2017-02-12 21:42:58

What could be the problem with 403 Forbidden nginx?

Displays a 403 Forbidden error. Before that everything worked fine. I set up mysql, after that it started.
Here is what is in the logs:

2017/02/12 13:34:27 [error] 2407#2407: *2 directory index of "/var/www/html/" is forbidden, client: 192.168.1.101, server: localhost, request : "GET / HTTP/1.1", host: "192.168.1.104"
config settings:
server {
listen 80;
server_namelocalhost;
root /var/www/html;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ =404;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/html;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

gave access to files:

drwxrwxrwx 2 nginx nginx 22 Feb 12 13:10 html
in nginx.conf
user nginx;

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question