似乎系统本身正在停止我的 nginx 反向代理,nginx 日志或系统日志中没有错误,我得到的信息如下:
root@production:~# 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: inactive (dead) since Wed 2021-02-10 08:22:09 -03; 2h 35min ago
Docs: man:nginx(8)
Process: 15642 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 15643 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 22295 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCCESS)
Main PID: 15644 (code=exited, status=0/SUCCESS)
fev 09 17:01:13 production systemd[1]: Starting A high performance web server and a reverse proxy server...
fev 09 17:01:13 production systemd[1]: Started A high performance web server and a reverse proxy server.
fev 10 08:22:09 production systemd[1]: Stopping A high performance web server and a reverse proxy server...
fev 10 08:22:09 production systemd[1]: nginx.service: Succeeded.
fev 10 08:22:09 production systemd[1]: Stopped A high performance web server and a reverse proxy server.
这是出现在系统日志,每次停止日志都是一样的,这样root用户启动会话,nginx就启动关闭了。
Feb 10 08:22:09 production systemd[1]: Started Session 158 of user root.
Feb 10 08:22:09 production systemd[1]: Stopping A high performance web server and a reverse proxy server...
Feb 10 08:22:09 production systemd[1]: nginx.service: Succeeded.
Feb 10 08:22:09 production systemd[1]: Stopped A high performance web server and a reverse proxy server.
Feb 10 08:22:09 production systemd[1]: session-158.scope: Succeeded.
当我使用命令查看最后的登录信息时last -10
,我发现只有我登录了系统而没有其他人,就好像操作系统本身正在停止 nginx 一样,有人可以帮助我吗?
我忘了提到 nginx 运行了一段时间,然后突然停止,例如上次它运行了 21 个小时然后独自停止了。