尝试访问我的简单测试页面时禁止使用403
我刚刚安装了nginx,并且正在尝试设置我的第一个站点。我正在尝试将nginx与php-fpm一起使用。已安装nginx(当我转到ip时,将获得默认的欢迎使用nginx页面)。 现在,我正在尝试运行一个简单的脚本: <?php phpinfo(); 但我一直打到403禁止页面。在我的虚拟主机的日志中,我可以看到很多行,例如: 2012/05/18 01:29:45 [error] 4272#0: *1 access forbidden by rule, client: x.170.147.49, server: example.com, request: "GET / HTTP/1.1", host: "example.com" 该文件是/srv/www/test/index.phpnginx的所有者(我777尝试将包括文件在内的完整路径都删除了)。 我已经检查过nginx确实确实nginx/nginx在配置中的用户和组下运行。在nginx.conf中,我更改了默认配置包含路径,以确保没有其他配置挡住(include /etc/nginx/sites-enabled/)。 我正在使用的配置看起来像(如果您需要其他配置(php-fpm / nginx.conf),请告诉我): server { listen 80; server_name example.com; root /srv/www/test; access_log /var/log/nginx/example-access.log; error_log /var/log/nginx/example-error.log error; location ~ /. { access_log off; log_not_found …