Member-only story

Getting Started with Nginx

Maciej
7 min readOct 12, 2020

--

Introduction:

Nginx is a lightweight, highly extensible open source HTTP server. Today, it is said to account for dozens of percent of websites around the world. It has also been found that nginx has a high share, especially in large-scale web services. This is also related to the fact that nginx was created to solve the C10K problem (one server can handle connections from 10,000 clients at the same time and the server cannot keep up). By combining techniques such as event-driven, I/O Multiplexing, non-blocking I/O, and asynchronous IO, it has a robust architecture that can withstand C10K problems.

Nginx basic design

A directive is used as the basic description method of the configuration file.
There are three main ways to write directives: a type that simply specifies one parameter, a type that specifies multiple parameters, and a directive with a block. In particular, the specified value in the directive with block is called the context.

  • Directive to specify parameters:
worker_processes 1;
  • Directive to specify multiple parameters:
error_log /var/log/nginx/error.log error;
  • Directive with block:
server {
server_name some-website.example.com;
root /var/www/html;
}
  • Virtual server (server directive): With nginx, it is possible to run multiple HTTP servers with different settings for each IP…

--

--

Maciej
Maciej

Written by Maciej

DevOps Consultant. I’m strongly focused on automation, security, and reliability.

No responses yet