配置 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:
nginx: configuration file /etc/nginx/nginx.conf test failed
错误原因是:在配置文件时,访问路径设置了两个,重复配置webroot路径导致,去掉一个就可以了。
server {
listen default_server; #root /usr/share/nginx/html/;去掉这行
index index.html index.htm;
# Make site accessible from http://localhost/
root /home/wangkongming/webroot/blogs; index index.html index.htm;
server_name blogs.local; location / {
try_files $uri $uri/ =;
} location ~ \.php$ {
fastcgi_pass 127.0.0.1:;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
access_log /data/logs/blogs/access.log;
error_log /data/logs/blogs/error.log; }
配置 nginx server 出现nginx: [emerg] "root" directive is duplicate in /etc/nginx/server/blogs.conf:7的更多相关文章
- nginx: [emerg] "fastcgi_pass" directive is duplicate in /etc/nginx/sites-enabled/default:57
/************************************************************************************************ * ...
- nginx: [emerg] unknown directive "stub_status" in /home/oscf/nginx/conf/conf.d/ngx_metric.conf
解压安装过程命令如下: cd /home/oscf #该目录下有nginx压缩包 mkdir nginx tar -zxvf nginx-1.16.0.tar.gz cd nginx-1.16.0 . ...
- nginx重写rewrite的[emerg] unknown directive
今天写nginx的重写规则.怎么写总是报这个错误.
- nginx:[emerg]unknown directive "ssl"
nginx: [emerg] unknown directive "ssl" in /usr/local/nginx/conf/nginx.conf:102 到解压的nginx目录 ...
- 启动 nginx 失败 "fastcgi_pass" directive is duplicate
[emerg] 4953#0: "fastcgi_pass" directive is duplicate in /etc/nginx/sites-enabled/default: ...
- Nginx配置SSL报错 nginx: [emerg] unknown directive "ssl"
Nginx配置SSL报错 nginx: [emerg] unknown directive "ssl" 出现如图所示错误,处理办法如下 去nginx解压目录下执行 ./co ...
- 错误提示 nginx: [emerg] unknown directive "gzip_static"
1.检查nginx配置文件错误提示如下: [root@server nginx]# /applications/nginx/sbin/nginx -t -c /applications/nginx/n ...
- nginx: [emerg] unknown directive "聽" in D:\software03\GitSpace\cms\nginx-1.14.0/conf/nginx.conf:36
nginx: [emerg] unknown directive "聽" in D:\software03\GitSpace\cms\nginx-1.14.0/conf/nginx ...
- nginx: [emerg] unknown directive “ ” in /usr/local/nginx/nginx.conf.conf:xx报错处理
当我们在修改Nginx的配置文件,然后加载配置文件./nginx -s reload 报错类似的错误, nginx: [emerg] unknown directive “ ” in /usr/l ...
随机推荐
- js-JavaScript高级程序设计学习笔记18
第21章 AJAX 4.跨域源资源共享 CORS跨域源资源共享,其背后思想,是使用自定义的HTTP头部让浏览器与服务器进行沟通,从而决定请求或响应是否应该成功. 1.IE对CORS的实现 在IE8中引 ...
- 【BZOJ-1857】传送带 三分套三分
1857: [Scoi2010]传送带 Time Limit: 1 Sec Memory Limit: 64 MBSubmit: 1077 Solved: 575[Submit][Status][ ...
- poj2318
题意:把一个矩形划分成n部分,再给出一堆点,求每个部分内落入了多少点 sol attempt1:暴力 注意每个polygon中的点要按笔画的顺序排列好.还有就是有的点可能落在了upper or low ...
- 洛谷P1808 单词分类
题目描述 Oliver为了学好英语决定苦背单词,但很快他发现要直接记住杂乱无章的单词非常困难,他决定对单词进行分类. 两个单词可以分为一类当且仅当组成这两个单词的各个字母的数量均相等. 例如“AABA ...
- tyvj2018 小猫爬山
之前做过一道题"破锣摇滚乐队",把猫都编了号,每辆车只能装一些编号递增的猫,而且前一辆车的猫编号都比后一辆车小.那道题的DP状态是:f[i][j]表示装了前i只猫,使用了j辆车时第 ...
- 缺陷管理系统mantisbt环境搭建
mantisbt 搭载在lamp环境下 <VirtualHost *:8000> DocumentRoot "/data/mantisbt" </VirtualH ...
- 数据结构算法C语言实现(七)--- 3.1栈的线性实现及应用举例
一.简述 栈,LIFO.是操作受限的线性表,和线性表一样有两种存储表示方法.下面以顺序存储为例,实现. 二.ADT 暂无. 三.头文件 //3_1.h /** author:zhaoyu email: ...
- NYOJ 16 矩形嵌套(经典动态规划)
传送门 Description 有n个矩形,每个矩形可以用a,b来描述,表示长和宽.矩形X(a,b)可以嵌套在矩形Y(c,d)中当且仅当a<c,b<d或者b<c,a<d(相当于 ...
- Cost Function Summary
Mean Square Error \[cost(t,o)=\frac{1}{n}\sum\limits_{i=1}^n{(o-t)^2}\] Binary Cross-Entropy 用于计算 ta ...
- Servlet3.0中Servlet的使用
目录 1.注解配置 2.异步调用 3.文件上传 相对于之前的版本,Servlet3.0中的Servlet有以下改进: l 支持注解配置. l 支持异步调用. l 直接有对文件上传的支持. 在这篇 ...