duan5362 2015-03-09 21:27
浏览 231

停止nginx重定向到/ public文件夹

I'm hosting a VM at 192.168.33.10 and configured my webroot to /home/vagrant/www.

Within this I've placed an index.php. Navigating to 192.168.33.10/index.php serves the file, but navigating to 192.168.33.10 always redirects to 192.168.33.10/public

How do I disable this public redirect?

EDIT - included '/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;
}
  • 写回答

1条回答 默认 最新

  • dongmacuo1193 2015-03-09 21:53
    关注

    Ok, feel stupid. Chrome's browser was consistently autocompleting to 192.168.33.10/public! - had to clear the cache and all is fine.. Unsure how to prevent this behaviour in Chrome

    评论

报告相同问题?

悬赏问题

  • ¥15 msix packaging tool打包问题
  • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线