Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xeu nginx.service" for details.
nginx.service的作業失敗,因為控制進程已退出,錯誤代碼為。
有關詳細信息,請參閱“systemctl狀態nginx.service”和“journalctl-xeu nginx.service”。
解決辦法:
1.nginx -t 應測試所有文件並返回錯誤和警告位置
nginx: [emerg] unexpected end of file, expecting "}" in /etc/nginx/sites-enabled/default:94
nginx: configuration file /etc/nginx/nginx.conf test failed
nginx:[emerg]意外的文件結尾,在/etc/nginx/sites enabled/default:94中應為“}”
nginx:配置文件/etc/nginx/nginx.conf測試失敗
2.針對提出的第一個問題在其對應的文件目錄進行修改解決;

3. 在nginx.conf里的http中加上這句話:
limit_conn_zone $binary_remote_addr zone=addr:10m;

4.輸入nginx -t 測試
5.查詢錯誤日志
sudo nano /var/log/nginx/error.log

以上錯誤告訴我們,因為它已在使用中,所以無法將nginx綁定到端口80.
要解決此問題,您需要運行以下命令:
yum install net-tools
sudo netstat -tulpn
執行上述操作時,您將獲得類似以下的內容:

您可以看到端口80被httpd(Apache)阻止了. 獲取使用端口80或443的進程的PID.並發送更改<PID>值的kill命令
sudo kill -2 <PID>
請注意,在我的示例中,Apache的PID值為18261,因此我將執行sudo kill -2 18261

或者,您可以執行以下操作:
sudo fuser -k 80/tcp
sudo fuser -k 443/tcp
現在端口80或443已清除,您可以通過運行以下命令來啟動Nginx:
sudo service nginx restart