nginx 的root根目录配置问题

location ~ .php$ {
            root           /Users/web/Documents/php;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
            
            
我上面配置的根目录是 /Users/web/Documents/php
但是我在该目录新建1.php,重启了nginx 服务,找不到1.php ?
怎么回事??
阅读 6.5k
4 个回答

你默认访问的是index.php啊

新手上路,请多包涵

/Users/web/Documents/php 在这之后加个斜杠试试。
"/Users/web/Documents/php/",如此这般

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题