location / { autoindex on; } chown -R www-data:www-data /var/www usermod -a -G www-data rootnano /etc/nginx/nginx.conf#change the first line user www-data; nginx -s reload
原因 1. SELinux为开启状态(enabled) 查看SELinux的状态 sestatus 如果不是 disables , 需要 vi /etc/selinux/config 将以前的 SELINUX=enforcing 改为 SELINUX=disabled ,如下所示 # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enf