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. 轮播图--使用原生js的轮播图

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  2. NPOI 将excel转换为datatable或者将datatable转换为excel

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...

  3. 多进程编程——理论讲解与 multiprocessing 模块

    多进程编程 import os pid = os .fork() 功能 :创建新的进程 参数: 无 返回值 :失败返回一个负数 成功:在原有进程中返回新的进程的PID号 在新进程中返回为0* 子进程会 ...

  4. 【Day3】4.Xpath语法与案例

    课程目标 1.谷歌浏览器配置Xpath 2.Xpath常用语法 3.Xpath常用案例 1.谷歌浏览器配置Xpath Xpath下载:http://chromecj.com/web-developme ...

  5. easyUI 布局

    Layout(布局) 布局容器有5个区域:北.南.东.西和中间.中间区域面板是必须的,边缘的面板都是可选的. 每个边缘区域面板都可以通过拖拽其边框改变大小,也可以点击折叠按钮将面板折叠起来.布局可以进 ...

  6. Vim技巧----选取一个单词

    viw 它的作用是选取一个单词(word),无论光标在这个单词的哪个位置都能选中整个单词. 每日一Vim(18)Text-Object 前两节讲了Visual mode相关内容,这里提一个小问题,“如 ...

  7. VS---《在VS2010中 使用C++创建和使用DLL》(003)

    VS---<在VS2010中 使用C++创建和使用DLL>(003) 这里实现一下,之前写好的一个工程(定义一个函数f + main函数调用),转成DLL.调用DLL测试.在两个工程里,分 ...

  8. 学习elasticsearch(一)linux环境搭建(3)——head插件安装

    对于5.x的es,head插件不支持 ./elasticearch-plugin install [plugin_name]方式安装. 进入正文 1.首先确保你的机器安装了python,如果没有,请看 ...

  9. java递归方法查找某目录下包含有某字符串的文件

    最近在安装mysql5.6的时候,因为是免安装版的所以有些配置项需要手动配置.但是配置某一项的时候(例如:max_allowed_packet=xxxxx),不知道max_allowed_packet ...

  10. CentOS 6 多实例 编译安装mariadb-5.5.59

    系统平台: CentOS release 6.9 (Final) 内核 2.6.32-696.el6.x86_64 1.去官网下载适合的源码包 http://mariadb.org/ mariadb- ...