【发布时间】:2015-03-09 21:27:43
【问题描述】:
我在192.168.33.10 托管一个VM,并将我的webroot 配置为/home/vagrant/www。
我在其中放置了一个index.php。导航到192.168.33.10/index.php 提供文件,但导航到192.168.33.10 总是重定向到192.168.33.10/public
如何禁用此公共重定向?
编辑 - 包括“/etc/nginx/sites-enabled/default”:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /home/vagrant/www;
index index.php index.html index.htm;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
【问题讨论】:
-
index.php所在目录下是否有.htaccess文件?这可能会导致重定向?
-
不,这是全新安装 - 未安装或从未使用过 apache
-
检查 nginx.conf!
-
我检查了 nginx.conf - 根本没有提到“公共”这个词。这是使用 apt-get 全新安装的 nginx。原始 index.html 是从 192.168.33.10/public 提供的,即使它不存在
-
对整个网站进行系统搜索以供公众使用。它可能隐藏在您可以俯瞰的某个地方。