配置 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 ...
随机推荐
- [vijos1427]机密信息
Description 有个很奇怪的习惯,他把他所有的机密信息都存放在一个叫机密盘的磁盘分区里,然而这个机密盘中却没有一个文件,那他是怎么存放信息呢?聪明的你一定想到了,的信息都是以文件夹名称的形式保 ...
- ListView的使用-模拟微博随便看看栏目【执行与优化】
今天我们来讲述一下如何使用ListView来模仿微博随便看看栏目(ps:这是老师布置的作业,所以…),在前篇博客中,我们讲述了细解ListView之自定义适配器的使用,所以本篇我们不以特别详细的讲述( ...
- Jquery 随便写些知识点
针对jQuery随便写些觉得还挺实用的一些东西,也没系统的去理一番,只是想到哪写到哪,写的不完全也请多见谅. jQuery和其他javascript库产生$符号冲突了?$符号想必用jQuery的人都不 ...
- Code::Blocks快捷键操作
编辑器 快捷键 功能 Ctrl+Z 恢复上一次操作 Ctrl+Shift+Z 重复上一次操作 F11 切换头文件/源文件 Ctrl+Shift+C 注释高亮代码 Ctrl+Shift+X 反注释高亮代 ...
- [Eclipse]解决: Eclipse Maven “Add Dependency”搜索无结果
转载: http://www.educity.cn/wenda/469389.html eclipse插件Maven添加依赖查询无结果的解决方法(Select Dependency doesn't w ...
- jquery获取复选框的值
勾选checkbox,并把勾选的值显示在某个div中 <!DOCTYPE html > <html> <head> <meta charset="U ...
- HTML5学习总结-01 开发环境和历史
1 搭建HTML5开发环境 1 安装一款支持HTML5的浏览器 FireFox, Chrome 2 开发工具 SublineText, Eclipse, HBuilder, WebStorm 注:使用 ...
- 常用机器视觉工具----图像分析工具(blob分析)
http://blog.sina.com.cn/s/blog_67cc4eb70100ivnt.html Blob分析:Blob分析目的在于对图像中的2-D形状进行检测和分析,得到诸如目标位置.形状. ...
- Linux常用服务部署与优化之NFS篇
NFS(network file system)的简称,是linux系统之间常用的一种文件共享方式,下面简述其搭建过程,需要两个linux系统的虚拟机,假设客户端的ip为192.168.1.105,服 ...
- 结合Hadoop,简单理解SSH
在启动dfs和yarn时,需要多次输入密码,不但启动本机进程还有辅服务器启动那些节点也需要相应密码,主与辅服务器之间是通过SSH连接的,并发送操作指令 一.ssh密码远程登录 1.使用ssh连接另一台 ...