当前位置: 首页 > 知识库问答 >
问题:

如何解决这个问题,Nginx在我重新启动时停止

上官英哲
2023-03-14

我使用的是Centos7.6,主线是nginx,安装了nginx.org的最新版本。

[root@host~]#systemctl status nginx.service*nginx.service-nginx-高性能web服务器已加载:已加载(/usr/lib/systemd/system/nginx.service;已启用;供应商预置:已禁用)活动:活动(运行)自Tue 2019-06-25 18:41:49 UTC;22分钟前文档:http://nginx.org/en/docs/process:670 execstop=/bin/kill-s TERM$mainpid(code=exited,status=0/success)process:691 execstart=/usr/sbin/nginx-c/etc/nginx/nginx.conf(code=exited,status=0/success)Main pid:692(nginx)cgroup:/system.slice/nginx.service-692nginx:master process/usr/sbin/nginx/nginx.conf

6月25日18:41:49主机系统D[1]:启动nginx-高性能web服务器...6月25日18:41:49主机SystemD[1]:PID文件/var/run/nginx.PID不可读(还不能读?)启动后。6月25日18:41:49主机SystemD[1]:启动NGINX-高性能web服务器。[root@host~]#systemctl重新启动nginx.service的nginx作业失败,因为控制进程以错误代码退出。有关详细信息,请参阅“SystemCTL status nginx.service”和“JournalCTL-xe”。[root@host~]#systemctl status nginx.service*nginx.service-nginx-高性能web服务器加载:加载(/usr/lib/systemd/system/nginx.service;enabled;供应商预置:disabled)活动:失败(结果:exit-code)自UTC Tue 2019-06-25 19:04:56;21年前的文档:http://nginx.org/en/docs/process:858 execstop=/bin/kill-s TERM$mainpid(code=exited,status=0/success)process:861 execstart=/usr/sbin/nginx-c/etc/nginx/nginx.conf(code=exited,status=1/failure)主pid:692(code=exited,status=0/success)

6月25日19:04:56主机系统D[1]:启动nginx-高性能web服务器...6月25日19:04:56主机nginx[861]:nginx:[emerg]“服务器”指令在/etc/nginx/nginx.conf:33 6月25日19:04:56主机systemd[1]:nginx中不允许。服务:控制进程已退出,代码=exited状态=1 6月25日19:04:56主机systemd[1]:无法启动nginx-高性能web服务器。6月25日19:04:56主机SystemD[1]:单元NGINX.服务进入失败状态。6月25日19:04:56主机SystemD[1]:Nginx.Service失败。

可能是apache侦听端口:80(httpd)。如果是,如何删除它,并将nginx设置为默认每次引导。除此之外,我不知道是什么导致了这个问题。我正在尝试使用Nginx作为反向代理。任何有效的解决方案都是有价值的。这是我第三次安装Nginx。

共有1个答案

万俟财
2023-03-14

您的消息中有一个配置错误:

在/etc/nginx/nginx.conf:33中不允许使用host nginx[861]:nginx:[emerg]“server”指令

这意味着在/etc/nginx/nginx.conf的第33行,不应该有“server”语句。

 类似资料:
  • 启动错误 ApplicationContext.若要显示条件报告,请在启用“调试”的情况下重新运行应用程序。2019-10-17 15:44:43.968错误10460--[main]O.S.Boot.SpringApplication:应用程序运行失败 我的pom.xml:

  • 我正试图在Android Studio上调试我的项目——一个非常简单的东西——hello world。我得到这个信息: "安装未成功。应用程序无法安装:INSTALL_FAILED_MISSING_SHARED_LIBRARY apk列表:[0]'C:\Users\Pierr\AndroidStudioProjects\Hello\app\build\outputs\apk\debug\app d

  • 正在启动Gradle守护进程...Gradle守护进程5 s 654 ms启动 失败:生成失败,出现异常。 > 其中:构建文件'c:\users\asus\androidstudioprojects\culturelwordsgame\app\Build.gradle'行:1 错误:评估项目':app'时出现问题。 未能应用插件[id'com.android.internal.version-ch

  • 本文向大家介绍nginx 重新启动NGINX,包括了nginx 重新启动NGINX的使用技巧和注意事项,需要的朋友参考一下 示例 以root用户身份: Ubuntu的例子            

  • 问题内容: 我很难找到一种方法来启动,停止和重新启动Java中的线程。 具体来说,我在中有一个类Task(当前实现)。我的主应用程序需要能够在线程上启动此任务,在需要时停止(杀死)该线程,有时还可以杀死并重新启动该线程… 我的第一次尝试是与,但我似乎找不到办法重新启动任务。当我使用任何将来的呼叫失败时,因为是“关机” … 那么,我该怎么做呢? 问题答案: 一旦线程停止,你将无法重新启动它。但是,没

  • 我怎么能解决这个问题? 颤振并建立网络 具有良好零安全性的建筑物 目标dart2js失败:异常:警告:'dart2js'entrypoint脚本已弃用,请改用'dart compile js'。 /C:/用户/DELL/AppData/本地/发布/缓存/托管/pub.dartlang.org/flutter_screenutil-5.3.1/lib/screenutil_init.dart: 23