Ошибка Access denied в nginx?

Установил сервер нгинх, поставил в корень файл index.php, но при заходе на страницу вижу сообщение "Access denied". В чем может быть ошибка? Вот конфиг нгинх:
server {
listen 80 default_server;
listen [::]:80 default_server;

# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# include snippets/snakeoil.conf;

root /var/www/html;

# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;

server_name _;

location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
root /var/www/html;
}

# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php-fpm (or other unix sockets):
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}
  • Вопрос задан
  • 2086 просмотров
Пригласить эксперта
Ответы на вопрос 2
semennovikov123
@semennovikov123
Backend Developer
https://stackoverflow.com/questions/21909860/acces...

SELinux попробуй отключить, может в этом проблема.
Ответ написан
Комментировать
unwrecker
@unwrecker
1. Надо посмотреть логи nginx и php.
2. Можно проверить без php: положить в корень сервера файл index.html и загрузить его.
3. Проверить действительно ли сокет php находится тут: unix:/var/run/php/php7.2-fpm.sock
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы