win7下关于nginx配置的路径问题
来源:互联网 发布:阿里云https部署 编辑:程序博客网 时间:2024/05/21 16:54
从github上拉下来的项目
然后在nginx配置文件中配置项目路径:如下
server {listen 8883;server_name localhost;index index.php index.html index.htm;set $root_path 'F:\PHP+Nginx\Workspace\Tour\tour-of-api\public';root $root_path;......... //省略}在访问项目的时候报错404 notfound
然后查看nginx的日志文件:error.log文件,发现报错,如下:
2017/09/09 17:44:04 [crit] 5912#5800: *28 GetFileAttributesEx() "F:\PHP+Nginx\Workspace\Tourour-of-api\public/index.php" failed (123:
The filename, directory name, or volume label syntax is incorrect), client: 127.0.0.1, server: localhost,
request: "GET /api/index/index HTTP/1.1", host: "localhost:8883"发现 F:\PHP+Nginx\Workspace\Tour our-of-api 中间多了一个tab
网上查找,发现是nginx配置的路径问题,由于在Windows下文件路径可以用”\”, 也可以用”\\”, 也可以用”/”作为路径做分隔符。但”\”最容易引发问题,所以要尽量避免使用。
修改配置文件,如下
server {listen 8883;server_name localhost;index index.php index.html index.htm;set $root_path 'F:\PHP+Nginx\Workspace\Tour/tour-of-api\public';root $root_path;......... //省略}
项目访问成功!
阅读全文
0 0
- win7下关于nginx配置的路径问题
- WIN7 + VS2015环境下关于GLEW和GLFW的配置
- win7下关于session 0 存在的问题
- 在eclipse下关于tomcat配置的问题
- Linux下关于NFS的配置步骤
- Ubuntu下关于tftp的配置
- 标记下关于保留小数的问题
- centos7下关于拨号上网的一点问题
- Mac下关于pygame安装的问题
- Windows下关于文件路径的函数(shlwapi.h)
- linux下关于mySQL的安装和配置
- Ubuntu下关于Mysql及其图形界面的配置
- Ubuntu下关于Mysql及其图形界面的配置
- windows下关于Objective-C开发环境的配置
- ubuntu下关于git的配置和使用
- Linux系统下关于网络ip地址的配置方法
- Ubuntu下关于Transmission daemon的安装与配置
- linux下关于网络配置(永久性的)
- MyBatis插入时候获取自增主键方法
- 京东选择题总结
- Unity 贪吃蛇2D简易制作(二)
- Python从零开始(集成开发环境VS)
- [python] 老男孩 作业二的解答
- win7下关于nginx配置的路径问题
- 跨浏览器事件兼容,巧妙处理方法
- 祝自己 19岁 生日快乐。。。
- ORA-01502 重建索引方法
- softethervpn 安装
- 函数调用的一些易错
- Longest Substring Without Repeating Characters
- mvc开发模式(别人写的拿来学习学习)
- 2017 ACM-ICPC 亚洲区(乌鲁木齐赛区)网络赛-G: Query on a string(线段树+预处理)