• nginx.service


    自己的服务器报502错误,检查nginx状态时报错:

    ubuntu@VM-0-13-ubuntu:/etc/nginx/sites-enabled$ service nginx status 
    ● nginx.service - A high performance web server and a reverse proxy server
       Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
       Active: failed (Result: exit-code) since Wed 2020-02-26 00:26:39 CST; 4min 0s ago
         Docs: man:nginx(8)
      Process: 1853 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
    
    Feb 26 00:26:39 VM-0-13-ubuntu systemd[1]: Starting A high performance web server and a reverse proxy server...
    Feb 26 00:26:39 VM-0-13-ubuntu nginx[1853]: nginx: [emerg] "server" directive is not allowed here in /etc/nginx/sites-enabled/
    Feb 26 00:26:39 VM-0-13-ubuntu nginx[1853]: nginx: configuration file /etc/nginx/nginx.conf test failed
    Feb 26 00:26:39 VM-0-13-ubuntu systemd[1]: nginx.service: Control process exited, code=exited status=1
    Feb 26 00:26:39 VM-0-13-ubuntu systemd[1]: nginx.service: Failed with result 'exit-code'.
    Feb 26 00:26:39 VM-0-13-ubuntu systemd[1]: Failed to start A high performance web server and a reverse proxy server.

    查了好一顿还没查出来为啥...先记一下,等解决了再更新...

    ----------------------------华丽分割线------------------------

    为啥查不出来呢,,因为是自己犯的超级初级的错误

    ubuntu@VM-0-13-ubuntu:~$ sudo nginx -t
    nginx: [emerg] "server" directive is not allowed here in /etc/nginx/sites-enabled/default:31
    nginx: configuration file /etc/nginx/nginx.conf test failed

    检查自己的配置文件,提示第31行有问题,打开看自己少写了个}...

    加上后重启下nginx

    ubuntu@VM-0-13-ubuntu:~$ sudo nginx -t
    nginx: [emerg] "server" directive is not allowed here in /etc/nginx/sites-enabled/default:31
    nginx: configuration file /etc/nginx/nginx.conf test failed

    再查看nginx状态就是active了

    ubuntu@VM-0-13-ubuntu:~$ service nginx status
    ● nginx.service - A high performance web server and a reverse proxy server
       Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
       Active: active (running) since Wed 2020-02-26 02:07:42 CST; 17s ago
         Docs: man:nginx(8)
      Process: 2765 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
      Process: 2754 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
     Main PID: 2769 (nginx)
        Tasks: 2 (limit: 2124)
       CGroup: /system.slice/nginx.service
               ├─2769 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
               └─2772 nginx: worker process
    
    Feb 26 02:07:42 VM-0-13-ubuntu systemd[1]: Starting A high performance web server and a reverse proxy server...
    Feb 26 02:07:42 VM-0-13-ubuntu systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
    Feb 26 02:07:42 VM-0-13-ubuntu systemd[1]: Started A high performance web server and a reverse proxy server.

    但还是报502错,,嗯?再查一下,查到再来更新

  • 相关阅读:
    jmeter中设置线程数与设置集合点的区别
    在linux系统中如何通过shell脚本批量设置redis键值对
    服务器带宽上行与下行的区别
    性能测试之Jmeter插件安装
    sqlserver 启用邮箱服务
    sqlserver 自定义字符串分割函数.
    C# 重写思想
    CSS控制鼠标滑过时的效果
    js实现图片自动切换效果。
    SQL Server Management Studio 使用作业实现数据库备份
  • 原文地址:https://www.cnblogs.com/cxl-blog/p/12364952.html
Copyright © 2020-2023  润新知