关于nginx报错/usr/share/nginx/html/jiankongshare" failed (2: No such file or directory)的问题解决
nginx的location虚拟目录配置:
monitor.conf
server {
server_name monitor.chinasoft.com;
server_name 1.1.1.1;
error_log /data/logs/web-acccess.log info;
access_log /data/logs/web-error.log;
location /jiankongshare{
alias /data/monitor_share; #正式环境地址
index index.html;
}
location /jian/{
proxy_set_header Host $host;
proxy_set_header X-Real-Ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://localhost:8082/;#正式服务器地址
}
}
访问1.1.1.1/jiankongshare报错如下:
2017/04/07 10:15:54 [error] 23876#0: *1 open() "/usr/share/nginx/html/jiankongshare" failed (2: No such file or directory), client: 61.141.64.212, server: monitor.chinaost.com, request: "GET /jiankongshare HTTP/1.1", host: "1.1.1.1"
2017/04/07 10:15:54 [error] 23876#0: *1 open() "/usr/share/nginx/html/jiankongshare" failed (2: No such file or directory), client: 61.141.64.212, server: monitor.chinaost.com, request: "GET /jiankongshare HTTP/1.1", host: "1.1.1.1"
2017/04/07 10:15:54 [error] 23876#0: *1 open() "/usr/share/nginx/html/jiankongshare" failed (2: No such file or directory), client: 61.141.64.212, server: monitor.chinaost.com, request: "GET /jiankongshare HTTP/1.1", host: "1.1.1.1"
2017/04/07 10:15:55 [error] 23876#0: *1 open() "/usr/share/nginx/html/jiankongshare" failed (2: No such file or directory), client: 61.141.64.212, server: monitor.chinaost.com, request: "GET /jiankongshare HTTP/1.1", host: "1.1.1.1"
2017/04/07 10:15:55 [error] 23876#0: *1 open() "/usr/share/nginx/html/jiankongshare" failed (2: No such file or directory), client: 61.141.64.212, server: monitor.chinaost.com, request: "GET /jiankongshare HTTP/1.1", host: "1.1.1.1"
分析:
nginx还是默认到
/usr/share/nginx/html/jiankongshare 这个根目录下去找我们的html文件,通过修改default.conf及nginx.conf的根目录也无法改变目录的配置,重启无效
其实有两台nginx做负载均衡,另外一台是ok的最后不得已直接删除nginx,重新安装,发现问题解决
解决办法:
关闭服务
service nginx stop
删除nginx
rpm -e --nodeps nginx-1.10.2-1.el6.x86_64
重新安装
yum install -y nginx
再次修改配置,启动nginx,再次访问1.1.1.1/jiankongshare 发现问题解决
关于nginx报错/usr/share/nginx/html/jiankongshare" failed (2: No such file or directory)的问题解决的更多相关文章
- CentOS中输入yum报错:sudo: unable to execute /bin/yum: No such file or directory
今天尝试更新了下虚拟机CentOS中的python版本后. 运行“yum”命令,就报错:“sudo: unable to execute /bin/yum: No such file or direc ...
- Centos下yum安装Nginx报错 No package nginx available.
在Centos6下使用yum安装Nginx报错 解决方案: yum install epel-release
- 安装nginx环境(含lua)时遇到报错ngx_http_lua_common.h:20:20: error: luajit.h: No such file or directory的解决
下面是安装nginx+lua环境时使用的相关模块及版本,ngx_devel_kit和lua-nginx-module模块用的都是github上最新的模块.并进行了LuaJIT的安装. #Install ...
- Xcode编译报错:< Apple Mach-O Linker Warning > clang: error: no such file or directory: 'xxxx'
Xcode编译报错概述: clang: error: no such file or directory: 'CoreGraphics' 一般原因是链接库内容导入丢失,这种的排查下target - B ...
- 解决HDFS无法启动namenode,报错Premature EOF from inputStream;Failed to load FSImage file, see error(s) above for more info
一.情况描述 启动hadoop后发现无法打开hdfs web界面,50070打不开,于是jps发现少了一个namenode: 查看日志信息,发现如下报错: 2022-01-03 23:54:10,99 ...
- 编译binutil包报错cc: error trying to exec 'cc1obj': execvp: No such file or directory
在http://forums.fedoraforum.org/showthread.php?t=267449中找到的解决方法 $LFS/sources/binutils-2.15.91.0.2/gpr ...
- Nginx 报错: nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory) 的解决方法
今天测试域名访问不了,登陆 Linux(Ubuntu)重启Nginx: nginx -s reload 结果报错: nginx: [error] open() : No such file or di ...
- nginx报错:./configure: error: C compiler cc is not found, gcc 是已经安装了的
源码安装nginx报错,找不到gcc,但是实际上gcc是存在的,如下: # ./configure checking for OS + Linux -.el7.x86_64 x86_64 checki ...
- 重启虚拟机后,再次重启nginx会报错:[emerg] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)
问题: 重启虚拟机后,再次重启nginx会报错: open() "/var/run/nginx/nginx.pid" failed (2: No such file or dire ...
随机推荐
- 关于程序设计中经常出现的INF和MOD值的设定
摘自:https://www.cnblogs.com/gfvod/p/5548313.html 在取模操作中,我们常把MOD设置为1000000007,模一个大数和模一个质数可以减少冲突,而1e9+7 ...
- 51nod1238 最小公倍数之和 V3
又被这神仙题给坑爆了. 神仙题解. 一开始我把lcm变成ij/gcd然后按照常规套路去推,推到最后发现不是miu * Id而是miu · Id......这还搞鬼啊. 正解居然跟这个差不多,先转成求其 ...
- Flash:使用FileReference上传在Firefox上遇到的问题终于解决了
以前使用的是这样的一句话:var uploadURL:URLRequest = new URLRequest();uploadURL.url = "upload.asp"; 测试发 ...
- poj 3207(2-SAT+SCC)
传送门:Problem 3207 https://www.cnblogs.com/violet-acmer/p/9769406.html 难点: 题意理解. 题意: 平面上有一个圆,圆上有n个点(分别 ...
- MYCAT扩容
一.原架构图: 二.扩容 在HOST1上新增节点db_user2 在HOST2上新增节点db_user2 三.操作步骤 1.mycat 所在环境安装 mysql 客户端程序 2.mycat 的 lib ...
- Linux命令之cd
cd命令 用处:跳转目录 用法:输入cd加上你想跳转的目录,这里分几种情况 示例: 一.进入当前目录的子目录 我现在的目录是 /home/jim,如图 这个目录下面有好多文件夹是吧,现在我想进入到其中 ...
- filebeat多个key
filebeat.prospectors:- type: log paths: - D:\logs\iis\W3SVC2\*.log exclude_lines: ['^#'] multiline: ...
- TCP和UDP的区别和优缺点
1.TCP与UDP区别总结: 1.TCP面向连接(如打电话要先拨号建立连接);UDP是无连接的,即发送数据之前不需要建立连接2.TCP提供可靠的服务.也就是说,通过TCP连接传送的数据,无差错,不丢失 ...
- 【JUC】CopyOnWriteArrayList
写入时复制(CopyOnWrite) 什么是CopyOnWrite容器 CopyOnWrite容器即写时复制的容器.通俗的理解是当我们往一个容器添加元素的时候,不直接往当前容器添加,而是先将当前容器进 ...
- matplotlib笔记——legend用法
rates = [0.01, 0.001, 0.0001] models = {} costs = np.array([[0.7, 0.9, 0.4, 0.6, 0.4, 0.3, 0.2, 0.1] ...