我的Windows 7机器上安装了nginx 1.11.10。 每当我访问my_domain.tld和xyz.my_domain.tld时,它总是返回目录索引“d:/ path / webroot /”被禁止 。 奇怪的是,在my_domain.tld / any_path和xyz.my_domain.tld / any_path下的index.php按预期工作。
在webroots上访问index.php的唯一方法是在地址栏中input/index.php。
我没有与index.html的问题。
这是我的configuration(错误页面的位置和自定义日志configuration不显示在这里)。 除了server_name和根path(d:/ path / webroot-xyz /)之外,xyz.my_domain.tld的块是相似的。
#HTTPS my_domain.tld server { listen 443 ssl; listen [::]:443 ssl; server_name my_domain.tld; charset utf-8; location / { root d:/path/webroot/; index index.php index.html; limit_req zone=one burst=5 nodelay; } #PHP FastCGI location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME d:/path/webroot/$fastcgi_script_name; include fastcgi_params; fastcgi_split_path_info ^(.+\.php)(/.+)$; } }