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. php 限制标题长度,将一个中文转换成一个字符

    点击链接加入群[php/web 学习课堂]:https://jq.qq.com/?_wv=1027&k=5UJ9vEa 欢迎大家加入,一起讨论学习 玩这个功能的时候,我们要注意一点,我们是用中 ...

  2. boost交叉编译

    运行bootstrap.sh # ./bootstrap.sh 生成b2.bjam和project-config.jam文件 修改project-config.jam using gcc : arm ...

  3. 使用LaTeX和KnitR自动生成报告

    扩展名为.Rnw(Rtex)的文件就是包含了R代码的LaTeX文档.编译的时候,先用Rscript调用Knitr处理,生成.TeX文档,然后用pdfLaTeX/XeLaTeX编译成PDF. 最方便的编 ...

  4. js页面内容只读,不可复制

    // document.oncontextmenu=new Function("event.returnValue=false"); // document.onselectsta ...

  5. ThinkPHP模板继承和修改title

    先说下模板继承: 假定:在View文件夹中 -> Public  公共模块 —>base/header/top/footer 4个html文件 这下面base文件使用include引入其他 ...

  6. 文件 file open函数的打开及 函数的调用

    文件 mode 模式字符的含义 字符 含义 'r' 以只读方式打开(默认) 'w' 以只写方式打开,删除原有文件内容(如果文件不存在,则创建该文件并以只写方式打开) 'x' 创建一个新文件, 并以写模 ...

  7. Hive正则表达式

    正则表达式基本语法 用圆括号将所有选择项括起来,相邻的选择项之间用|分隔.但用圆括号会有一个副作用,使相关的匹配会被缓存,此时可用?:放在第一个选项前来消除这种副作用. 其中 ?: 是非捕获元之一,还 ...

  8. anaconda环境中---py2.7下安装tf1.0 + py3.5下安装tf1.5

    anaconda环境中---py2.7下安装tf1.0 + py3.5下安装tf1.5 @wp20181030 环境:ubuntu18.04, anaconda2, ubuntu系统下事先安装了pyt ...

  9. Python数据库连接池 -组件 DBUtils

    DBUtils是Python的一个用于实现数据库连接池的模块 此连接池有两种连接模式: DBUtils提供两种外部接口: PersistentDB :提供线程专用的数据库连接,并自动管理连接. Poo ...

  10. R的数据结构--矩阵

    矩阵:存放相同类型元素的二维向量 参数解释 matrix(data=NA, nrow = 1, ncol = 1, byrow = FALSE, dimnames = NULL) 参数含义如下: da ...