O'Reilly logo

Mastering NGINX by Dimitri Aivaliotis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. A Configuration Guide

The NGINX configuration file follows a very logical format. Learning this format and how to use each section is one of the building blocks that will help you to create a configuration file by hand. This chapter will help you reach that goal by explaining the following topics:

  • Basic configuration format
  • NGINX global configuration parameters
  • Using include files
  • The HTTP server section
  • The virtual server section
  • Locations – where, when, and how
  • The mail server section
  • Full sample configuration

The basic configuration format

The basic NGINX configuration file is set up in a number of sections. Each section is delineated in the following way:

<section> {

    <directive> <parameters>;

}

It is important to note that each directive line ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required