An error occurred while restarting nginx In Ubuntu. * Restartingnginxnginx... fail! When the nginx service is restarted, the following error occurs: $ sudoservicenginxrestart * Restartingnginxnginx... fail! 1. The error is returned when an error is found in the nginx configuration file. Solution: $ sudong0000- tn
An error occurred while Restarting nginx In Ubuntu. * Restarting nginx... fail!
When the nginx service is restarted, the following error occurs:
$ Sudo service nginx restart
* Restarting nginx
... Fail! 1
The reason is that the nginx configuration file is incorrect.
Troubleshooting:
$ Sudo nginx-t
Nginx: [emerg] "location" directive is not allowed
Here in/etc/nginx. conf: 11
Nginx: configuration file/etc/nginx. conf
Test failed1
Modify the corresponding configuration file based on the error message.
CentOS 6.2 Deployment Nginx + MySQL + PHP http://www.linuxidc.com/Linux/2013-09/90020.htm
Build a WEB server http://www.linuxidc.com/Linux/2013-09/89768.htm with Nginx
Build a Web server http://www.linuxidc.com/Linux/2013-09/89692.htm Based on Linux6.3 + Nginx1.2 + PHP5 + MySQL5.5
Nginx Performance Tuning http://www.linuxidc.com/Linux/2013-09/89656.htm in CentOS 6.3
Configure Nginx to load ngx_pagespeed module http://www.linuxidc.com/Linux/2013-09/89657.htm under CentOS 6.3
CentOS 6.4 install and configure Nginx + Pcre + php-fpm http://www.linuxidc.com/Linux/2013-08/88984.htm
Nginx installation configuration use notes http://www.linuxidc.com/Linux/2014-07/104499.htm
Nginx log filtering using ngx_log_if does not record specific log http://www.linuxidc.com/Linux/2014-07/104686.htm
Nginx details: Click here
Nginx: Click here
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2
This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-07/119754.htm