1)下载地址

http://nginx.org/en/download.html

找windows的下载。

2)然后解压到自己的一个目录。

3)配置环境变量,将解压到的路径加进去。

4)修改配置文件

nginx/conf/nginx.conf文件,找server ->listen 把80端口改成其他的。如:8080

5)nginx启动 直接命令 nginx

报错:

nginx: [alert] could not open error log file: CreateFile() "logs/error.log" failed (3: The system cannot find the path specified)
2018/11/17 17:43:20 [emerg] 16204#3512: CreateFile() "C:\Users\Administrator/conf/nginx.conf" failed (3: The system cannot find the path specified)
原因:启动需要配置文件,指定配置文件命令

nginx -c D:\tool\nginx-1.15.6\conf\nginx.conf

报错:

nginx: [alert] could not open error log file: CreateFile() "logs/error.log" failed (3: The system cannot find the path specified)
2018/11/17 17:44:44 [emerg] 14976#4176: invalid number of arguments in "root" directive in D:\tool\nginx-1.15.6\conf\nginx.conf:45

配置文件root指定一个目录的时候,最末尾不能是"\"

再执行命令报错

nginx: [alert] could not open error log file: CreateFile() "logs/error.log" failed (3: The system cannot find the path specified)
2018/11/17 18:00:01 [emerg] 8664#1348: CreateDirectory() "C:\Users\Administrator/temp/client_body_temp" failed (3: The system cannot find the path specified)

去建目录:C:\Users\Administrator/temp/client_body_temp

C:\Users\Administrator>nginx -c D:\tool\nginx-1.15.6\conf\nginx.conf
nginx: [alert] could not open error log file: CreateFile() "logs/error.log" failed (3: The system cannot find the path specified)
2018/11/17 18:08:27 [emerg] 10848#8284: CreateFile() "D:\logs
ginx\error.log" failed (123: The filename, directory name, or volume label syntax is incorrect)

什么鬼,还带 \n转义的???

去配置文件里改路径 error_log  D:\logs\\nginx\error.log;

nginx: [alert] could not open error log file: CreateFile() "logs/error.log" failed (3: The system cannot find the path specified)
2018/11/17 18:18:29 [emerg] 10204#7268: unknown log format "main" in D:\tool\nginx-1.15.6\conf\nginx.conf:25

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

access_log  D:\logs\\nginx\access.log  main;

把这里打开

nginx: [emerg] CreateFile() "C:\Users\Administrator/logs/nginx.pid" failed (3: The system cannot find the path specified)

去配置文件改pid目录,或者去创建个目录

这个是个警告

nginx: [alert] could not open error log file: CreateFile() "logs/error.log" failed (3: The system cannot find the path specified)

进到安装目录

D:\tool\nginx-1.15.6>nginx -c conf\nginx.conf

执行,没有再警告了。访问配置的localhost:8080。看看有没有效果。
————————————————
版权声明:本文为CSDN博主「李逢涛」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/hebsun/article/details/84191029

nginx 错误集锦的更多相关文章

  1. 场景2 nginx 错误日志格式:

    nginx 错误日志格式: 2016/09/01 11:23:36 [error] 28388#0: *14549 open() "/var/www/zjzc-web-frontEnd/im ...

  2. SVN下错误集锦

    SVN下错误集锦 一SVN下的文件被locked不能update和commit 最近做项目的时候,遇到这个问题,SVN下的文件被locked不能update和commit.其提示如下: 解决办法:执行 ...

  3. (转)Hadoop之常见错误集锦

     Hadoop之常见错误集锦            下文中没有特殊说明,环境都是CentOS下Hadoop 2.2.0.1.伪分布模式下执行start-dfs.sh脚本启动HDFS时出现如下错误:   ...

  4. Nginx错误页面优雅显示

    一.Nginx错误页面优雅显示的原因?   当我们访问网站时,由于特殊的原因,经常会出现诸如403,404,503等错误,这极大的影响用户的访问体验,所以我们很有必要做一下错误页面的优雅显示,以提升用 ...

  5. Nginx 错误处理方法: bind() to 0.0.0.0:80 failed

    Nginx 错误处理方法: bind() to 0.0.0.0:80 failed 今天启动window上的nginx总是报错 错误信息是bind() to 0.0.0.0:80 failed (10 ...

  6. nginx错误界面优化和日志管理

    nginx错误界面优化 在进行web访问的时候,经常会遇到网站打不开报错的情况,nginx默认的界面并不美观,我们可以通过重定向到自定义的错误页面,提升用户体验,比如淘宝的错误页面还有商品信息和广告. ...

  7. Nginx 错误日志配置

    1.Nginx错误日志信息介绍: error_log的语法格式及参数说明: error_log      file         level; 关键字    日志文件   错误日志级别 其中,关键字 ...

  8. 在Hadoop 2.3上运行C++程序各种疑难杂症(Hadoop Pipes选择、错误集锦、Hadoop2.3编译等)

    首记 感觉Hadoop是一个坑,打着大数据最佳解决方案的旗帜到处坑害良民.记得以前看过一篇文章,说1TB以下的数据就不要用Hadoop了,体现不 出太大的优势,有时候反而会成为累赘.因此Hadoop的 ...

  9. drp错误集锦---“Cannot return from outside a function or method”

    好久都不动的项目,今天打开项目突然是红色感叹号.详细错误表现为: 也就是说,如今MyEclipse已经不识别在JSP页面中使用的return方法了(并且不止一处这种警告),那怎么办?????顿时闹钟一 ...

随机推荐

  1. 如何使用classnames模块库为react动态添加class类样式

    摘要 在react中添加动态的css时,传统的方式较为繁琐,今天刚好学习到一个模块库可以便捷的解决这个问题.对的,它就是“classnames”. classnames模块库 npm安装 npm in ...

  2. asp.net page类

    1  page 继承自control类 2 httpServerUtility的transfer方法:请求生命周期将在调用此方法之后终止,将不会触发后续的请求生命周期事件,将直接跳到logReques ...

  3. 2017JAVA面试题附答案

    JAVA基础 JAVA中的几种基本类型,各占用多少字节?   String能被继承吗?为什么? 不可以,因为String类有final修饰符,而final修饰的类是不能被继承的,实现细节不允许改变.平 ...

  4. cv2.videocapture()失败,无法读取视频

    原因:缺少ffmpeg的支持 解决:一般opencv3.3版本及以上支持ffmpeg,实验4.1.0成功 pip install opencv-python pip install opencv-co ...

  5. Docker镜像拉取失败或超时的解决办法:添加国内镜像

    $ docker pull php:7.1-fpm-alpine Error response from daemon: Get https://registry-1.docker.io/v2/: n ...

  6. late_initcall 替换 module_init

    今天在调试pwm驱动程序的时候,在__init函数中调用pwm_init后,则以太网不可用.pwm_init放在设备文件的open函数中,则系统正常运行. 这当中的区别就是硬件初始化函数pwm_ini ...

  7. Django模型层:单表操作,多表操作,常用(非常用)字段和参数,Django-model进阶

    一.web应用 二.模板的导入与继承 三.静态文件相关 四.inclusion_tag:返回html片段 五.模型层 一.web应用 -s包括两个部分:web服务器+application -目前阶段 ...

  8. [Educational Codeforces Round 63 ] D. Beautiful Array (思维+DP)

    Educational Codeforces Round 63 (Rated for Div. 2) D. Beautiful Array time limit per test 2 seconds ...

  9. python dict list 遍历的几种常见方法

    list 遍历index,value list = ['one', 'two', 'three'] for i in list: print(list.index(i),i) #rangefor i ...

  10. 平衡树treap 0基础详解

    刚开始学treap..同学在台上给我们讲,貌似除我之外的机房dalao们都听懂了就我发呆...(滑稽) 于是,事后的窝只能自己上网翻书研究了.... treap: treap=tree+heap,树+ ...