Description of Nginx Configuration Structure Division

Source: Internet
Author: User

Description of Nginx Configuration Structure Division

Http://developer.51cto.com/art/201003/190953.htm Nginx configuration requires some skills, we will find these in the constant use and maintenance, next I will introduce you to the Nginx configuration related skills. My current Nginx configuration is broken up, so that some configuration can be reused in many virtual hosts and directories. The overall structure is divided into the following:

Conf/Nginx. conf proxy. conf rewrite. conf location. conf port. conf upstream. conf servers/www.sudone.com www.163.com
 
  1. Nginx. conf is the main file to be read by Nginx configuration.
  2. Configuration of proxy. conf proxy options is also common
  3. Rewrite. conf is a common rewrite rule in the root directory of all hosts. It is a null file by default and can be left empty.
  4. Location. conf the location directory structure used by all hosts. It is a null file by default and can be left empty.
  5. Port. conf: Configure the server to bind the ip address and port, because Nginx configuration may have bugs If the ip port configuration of each host is different, so it is best to set it in a unified manner.
  6. Upstream. conf upstream is written here, which is separated from the business and easy to control.
  7. The servers directory contains all the virtual host configurations. Each virtual host has a file, which is included by Nginx. conf. This makes it flexible to process these configurations.

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.