nginx: [emerg] unknown directive “ ” in /usr/local/nginx/nginx.conf.conf:xx报错处理

当我们在修改Nginx的配置文件,然后加载配置文件./nginx -s reload   报错类似的错误,

nginx: [emerg] unknown directive “ ” in /usr/local/nginx/nginx.conf.conf:xx报错处理

那么,大多数我们就是配置刚刚写的这句代码的时候,多打了个空格,细心找一下,重写下就ok了!

原文地址:https://www.cnblogs.com/arebirth/p/errornginx01.html

时间: 2024-10-11 00:21:45

nginx: [emerg] unknown directive “ ” in /usr/local/nginx/nginx.conf.conf:xx报错处理的相关文章

nginx:[emerg]unknown directive "ssl"

nginx: [emerg] unknown directive "ssl" in /usr/local/nginx/conf/nginx.conf:102 到解压的nginx目录下 ./configure --with-http_ssl_module 当执行上面语句,出现./configure: error: SSL modules require the OpenSSL library. 用 yum -y install openssl openssl-devel 再执行./con

配置 nginx server 出现nginx: [emerg] "root" directive is duplicate in /etc/nginx/server/blogs.conf:7

在配置nginx 虚拟机时,执行 sudo /usr/sbin/nginx -t 报下面的错误: nginx: [emerg] "root" directive is duplicate in /etc/nginx/server/blogs.conf:7 nginx: configuration file /etc/nginx/nginx.conf test failed 错误原因是:在配置文件时,访问路径设置了两个,重复配置webroot路径导致,去掉一个就可以了. server {

nginx: [emerg] "fastcgi_pass" directive is duplicate in /etc/nginx/sites-enabled/default:57

/************************************************************************************************ * nginx: [emerg] "fastcgi_pass" directive is duplicate in /etc/nginx/sites-enabled/default:57 * 说明: * VPS安装Ubuntu 16.04,调一下Nginx的PHP Server. * * 20

mysq 安装时候进行生成数据库系统时候执行语句 ./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql 时候报错

我在安装数据库时候在系统进行生成数据库时候出现下面问题,就是在 scripts里面mysql_install_db没有执行权限, 进入到scripts目录下,执行chmod 777 mysql_install_db 给你所有权限,还真给面子,在执行图中语句时候,还真执行了.....

nginx: [emerg] host not found in upstream "baafile.yiche.com" in /usr/local/etc/nginx/nginx.conf:67

场景:nginx之前配置好的,直接启动即可,过了一段时间,突然启动报错. nginx: [emerg] host not found in upstream "baafile.yiche.com" in /usr/local/etc/nginx/nginx.conf:67 应该是 baafile.yiche.com  这个域名 之前可以访问,现在不能访问了.把此处的注释重启即可. 原文地址:https://www.cnblogs.com/kpengfang/p/12698756.htm

阿里云centOS7.4 nginx: [emerg] "server" directive is not allowed here in /etc/nginx/vhost/xxxxxx.conf:2

里云centOS7.4配置多个站点遇到的问题nginx: [emerg] "server" directive is not allowed here in /etc/nginx/vhost/xxxxxx.conf:2这个错误好尴尬,费了几个小时去解决,小白呀没办法 先贴下/etc/nginx/nginx.conf的内容 worker_processes 1; events { worker_connections 1024; } http { include mime.types;

Nginx报错nginx: [emerg] unknown log format "main"

故障描述: 在添加Nginx的子配置文件后报错误nginx: [emerg] unknown log format "main" 无法重新加载,仔细查看配置没有语法错误经过调试才发现是定义log_format的时候写到HTTP模块最下面,导致子配置文件无法识别. 错误的写法   include /opt/app/nginx/conf/conf.d/*.conf;   log_format  main  '$remote_addr - $remote_user [$time_local]

nginx: [error] invalid PID number "" in "/usr/local/webserver/nginx/logs/nginx.pid"

进入nginx文件下,例如 :/usr/local/nginx/sbin [[email protected] /]# cd /usr/local/nginx/sbin 运行命令: [[email protected] /]# ./nginx -c /usr/local/webserver/nginx/conf/nginx.conf 重新加载: [[email protected] /]# ./nginx -s reload 原文地址:https://www.cnblogs.com/gyrgyr

nginx检查报错:nginx: [emerg] "server" directive is not allowed here in

想检查一个配置文件是否正确,-c 指定之后发现有报错,如下: [[email protected]2:~# nginx -t -c /etc/nginx/conf.d/default.conf nginx: [emerg] "server" directive is not allowed here in /etc/nginx/conf.d/default.conf:1 nginx: configuration file /etc/nginx/conf.d/default.conf t