NGINX is a lightweight, high-performance web server designed for high-traffic use cases. One of NGINX’s strongest features is the ability to efficiently serve static content such as HTML and media files. NGINX uses an asynchronous event-driven model which provides predictable performance under load.
NGINX hands off dynamic content to CGI, FastCGI, or other web servers such as Apache. This content is then passed back to NGINX for delivery to the client. This document will familiarize you with basic NGINX parameters and conventions.
All NGINX configuration files are located in the /etc/nginx/ directory. The primary configuration file is /etc/nginx/nginx.conf.
Configuration options in NGINX are calleddirectives. Directives are organized into groups known as blocks or contexts. The two terms are synonymous.
Lines preceded by a character are comments and not interpreted by NGINX. Lines containing directives must end with a or NGINX will fail to load the configuration and report an error.
Below is a condensed copy of the /etc/nginx/nginx.conf file that is included with installations from the NGINX repositories. The file starts with 5 directives: user, worker_processes,error_log, and pid. These are outside any specific block or context, so they’re said to exist in the main context. The events and http blocks are areas for additional directives, and they also exist in the main context.
See the NGINX docs for explanations of these directives and others available in the main context.
All NGINX configuration files are located in the directory. The primary configuration file is /etc/nginx/nginx.conf.
Configuration options in NGINX are called directives. Directives are organized into groups known as blocks or contexts. The two terms are synonymous. Lines preceded by a # character are comments and not interpreted by NGINX. Lines containing directives must end with a;
or NGINX will fail to load the configuration and report an error.
Below is a condensed copy of the /etc/nginx/nginx.conf file that is included with installations from the NGINX repositories. The file starts with 5 directives:user, worker_processes, error_log, and pid. These are outside any specific block or context, so they’re said to exist in the main context. The events and http blocks are areas for additional directives, and they also exist in the main context. See the NGINX docs for explanations of these directives and others available in the main
How to Configure NGINX
Jul 31, 2018
NGINX is a lightweight, high-performance web server designed for high-traffic use cases.