初学ngenx的一个配置错误找不到原因

hetongfei 2018-09-29 02:08:39


就是照着慕斯网一字一字敲的
server{
listen 80;
autoindex off;
server_name img.ryanquan.com;
access_log d:\access.log combined;
index index.html index.htm index.jsp index.php;
#error_page 404 /404.html;
if ( $query_string ~* ".*[\;'\<\>].*" ){
return 404;
}

location ~ /(mmall_fe|mmall_admin_fe)/dist/view/* {
deny all;
}
location / {
root D:\ftpfile\img;
add_header Access-control_Allow_Origin *;
}
}
...全文
673 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
demiling 2018-10-19
  • 打赏
  • 举报
回复
标题:nginx. 慕斯网还是慕课网
hetongfei 2018-10-02
  • 打赏
  • 举报
回复
检查了一下是因为 我在conf/nginx.conf里面写多了一个一样的 include 所以报错了,谢谢
X-i-n 2018-09-30
  • 打赏
  • 举报
回复
把d:\nginx-1.19.3/conf/nginx.conf放出来。提示的意思是这儿不应该出现sever小节,估计是你在nginx.conf里把对vhost配置的引用语句放错位置了。
hetongfei 2018-09-29
  • 打赏
  • 举报
回复
nginx.exe -t nginx: [emerg] "server" directive is not allowed here in d:\nginx-1.10.3/vhost/image.imooc.com.conf:1 nginx: configuration file d:\nginx-1.19.3/conf/nginx.conf test failed

5,655

社区成员

发帖
与我相关
我的任务
社区描述
Web开发应用服务器相关讨论专区
社区管理员
  • 应用服务器社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧