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
- Nginx. conf is the main file to be read by Nginx configuration.
- Configuration of proxy. conf proxy options is also common
- 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.
- Location. conf the location directory structure used by all hosts. It is a null file by default and can be left empty.
- 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.
- Upstream. conf upstream is written here, which is separated from the business and easy to control.
- 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.