An error occurred while restarting Nginx In Ubuntu. * Restartingnginxnginx... fail!

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.