问题描述:禁用Plesk的Nginx代理,单独使用Apache,因为单独使用Apache时可以设置每个网站的带宽和连接数。重新启用Nginx代理后,发现重启服务器后,Nginx无法自动启动,运行systemctlstatusnginx.service出现如下错误信息,但可以通过systemctlstartnginx.servie手动启动.[root@www~]#systemctlstatusnginx.servicenginx.service-StartupscriptfornginxserviceLoaded:loaded(/usr/lib/systemd/system/nginx.service;enabled;vendorpreset:disabled)Active:failed(Result:exit-code)自2018年5月-01-1221:19:58CST;25sagoJanuary1221:19:57www.ezloo.comsystemd[1]:StartingStartupscriptfornginxservice...January1221:19:58www.ezloo.comnginx[844]:nginx:theconfigurationfile/etc/nginx/nginx.confsyntaxisokJan1221:19:58www.ezloo.comnginx[844]:nginx:[emerg]bind()to172.31.191.115:443failed(99:Cannotassignrequestedaddress)Jan1221:19:58www.ezloo.comnginx[844]:nginx:configurationfile/etc/nginx/nginx.conftestfailedJanuary1221:19:58www.ezloo.comsystemd[1]:nginx.service:controlprocessexited,code=exitedstatus=November1221:19:58www.ezloo.comsystemd[1]:FailedtostartStartupscriptfornginxservice.January1221:19:58www.ezloo.comsystemd[1]:Unitnginx.serviceenteredfailedstate.January1221:19:58www.ezloo.comsystemd[1]:nginx.servicefailed。解决方法:编辑/etc/sysctl.conf,添加如下一行代码:#allowprocessestobindtothenon-localaddressnet.ipv4.ip_nonlocal_bind=1再次运行:sysctl-p/etc/sysctl.conf重启服务器后发现Nginx可以正常启动,解决Plesk上Nginx无法自动启动的问题panel---这是合理的一般而言,在服务器上,单独使用Apache比使用Nginx作为代理需要更少的内存和CPU。毕竟Nginx还是占资源的。我不知道使用Nginx作为Plesk的前端代理的目的是什么。另外,由于使用了Nginx作为代理,我们应该允许前后端分离,即后端服务器在另一台服务器上。希望下次能看到这个功能。
