zoukankan      html  css  js  c++  java
  • nginx服务报错解决

    403禁止访问解决
    
    1、
    
    重要:修改配置文件使用虚拟机,否则怎么配置都不生效,添加如下用户
    
    [root@host-10-1-1-161 html]# ll /etc/nginx/nginx.conf
    -rw-r--r-- 1 root root 345 Aug 26 10:41 /etc/nginx/nginx.conf
    [root@host-10-1-1-161 html]# vi /etc/nginx/nginx.conf
    user root root;
    worker_processes 1;
    
    
    
    2、
    
    加上 index.php
    index index.html index.php
    
    
    3. 不要写成 test1.index.html  务必改成  index.html    多写个目录就多写几个目录
    
    
    
    
    503访问错误解决
    
    [root@host-10-1-1-161 ~]# curl oa.test.com
    <html>
    <head><title>502 Bad Gateway</title></head>
    <body bgcolor="white">
    <center><h1>502 Bad Gateway</h1></center>
    <hr><center>nginx/1.12.2</center>
    </body>
    </html>
    
    
    原因:防火墙没有关
    
    
    解决:
    
    [root@host-10-1-1-103 tomcat]# systemctl stop iptables
    [root@host-10-1-1-103 tomcat]# systemctl stop firewalld
    
    
    
    
    nginx [error] invalid PID number  in varrunnginxnginx.pid”
    
    解决
    
    nginx: [error] invalid PID number “” in “/usr/local/var/run/nginx/nginx.pid”
    在Mac上用brew安装Nginx,然后修改Nginx配置文件,再重启时报出如下错误:
    
    nginx: [error] invalid PID number "" in "/usr/local/var/run/nginx/nginx.pid"
    
    解决办法:
    
    $ sudo nginx -c /usr/local/etc/nginx/nginx.conf
     
    $ sudo nginx -s reload
    
    
    
    
    nginx: [warn] conflicting server name "localhost" on 0.0.0.0:80, ignored
    
    nginx: [warn] conflicting server name "localhost" on 0.0.0.0:80, ignored
    修改nginx配置参数后,使用nginx -t检查配置.
    
    提示successfull后就可以使用 nginx -s reload来重新加载配置
    
    
    nginx: [warn] conflicting server name "localhost" on 0.0.0.0:80, ignored
     
    
    意思是重复绑定了server name,但这个警告不会影响到服务器运行。
    
    而且,这个重复绑定的意思是现在运行的nginx服务和将要加载的新配置中的重复
  • 相关阅读:
    数据系统与分布式(二) 分布式数据系统(复制与分片)
    数据系统和分布式(一)数据系统基础
    可执行文件(ELF)的装载与进程
    HTTPS协议
    后台开发 缓存, 数据库, 高并发等等
    Golang中new和make的区别
    吴恩达:机器学习里面的作业1遇到的
    笔记——操作系统导论:环境配置
    笔记——操作系统导论:第二章
    Games 101 作业1代码解析
  • 原文地址:https://www.cnblogs.com/effortsing/p/10012438.html
Copyright © 2011-2022 走看看