NGINX Flashcards
NGINX is a web server that focuses on high performance, high c_______y, and low resource usage. Although it’s mostly known as a web server, NGINX at its core is a reverse p______y s_______.
NGINX is a web server that focuses on high performance, high concurrency, and low resource usage. Although it’s mostly known as a web server, NGINX at its core is a reverse proxy server.
In spite of the fact that Apache HTTP Server is more flexible, server admins often prefer NGINX for two main reasons:
It can handle a higher number of c________ requests.
It has faster static content d_____ with low r_____ u_____.
In spite of the fact that Apache HTTP Server is more flexible, server admins often prefer NGINX for two main reasons:
It can handle a higher number of concurrent requests.
It has faster static content delivery with low resource usage
NGINX’s configuration files end with the .c___ extension
NGINX’s configuration files end with the .conf extension
You can restart the NGINX service by executing the sudo s____ restart nginx command.
You can restart the NGINX service by executing the sudo systemctl restart nginx command.
Technically, everything inside a NGINX configuration file is a d_____. D______s are of two types:
Simple D______s
Block D_______s
Technically, everything inside a NGINX configuration file is a directive. Directives are of two types:
Simple Directives
Block Directives
When configured as a reverse proxy, NGINX sits b____ the client and a back end server. The client sends requests to NGINX, then NGINX passes the request to the back end.
When configured as a reverse proxy, NGINX sits between the client and a back end server. The client sends requests to NGINX, then NGINX passes the request to the back end.
Nginx uses a common practice called symbolic links, or symlinks, to track which of your server b____s are enabled.
Nginx uses a common practice called symbolic links, or symlinks, to track which of your server blocks are enabled.
Nginx uses a common practice called symbolic links, or s_____, to track which of your server blocks are enabled.
Nginx uses a common practice called symbolic links, or symlinks, to track which of your server blocks are enabled.
don’t skip over the documentation at the top of the default file that explains how to use it! it explains that it’s standard to disable the default config, which you can do by removing the symbolic link of the same name from the /etc/nginx/sites-enabled folder, and leave the /sites-available/default config file for reference as various things maintain/update it.
don’t skip over the documentation at the top of the default file that explains how to use it! it explains that it’s standard to disable the default config, which you can do by removing the symbolic link of the same name from the /etc/nginx/sites-enabled folder, and leave the /sites-available/default config file for reference as various things maintain/update it.
This environment variable automatically expands to the current user’s username
$USER: This environment variable automatically expands to the current user’s username
In order for Nginx to serve this content, it’s necessary to create a server block with the correct d_______s
In order for Nginx to serve this content, it’s necessary to create a server block with the correct directives
Instead of modifying the default configuration file directly, let’s make a new one with sudo nano /etc/nginx/s___s-a_______/your_domain
Instead of modifying the default configuration file directly, let’s make a new one at /etc/nginx/sites-available/your_domain
Nginx uses a common practice called symbolic links, or symlinks, to track which of your server blocks are enabled. Creating a symlink is like creating a s______ on disk, so that you could later delete the s______ from the sites-enabled directory while keeping the server block in sites-available if you wanted to enable it.
Nginx uses a common practice called symbolic links, or symlinks, to track which of your server blocks are enabled. Creating a symlink is like creating a shortcut on disk, so that you could later delete the shortcut from the sites-enabled directory while keeping the server block in sites-available if you wanted to enable it.
The listen directive can be set to:
An IP address/port combo.
A lone IP address which will then listen on the default port __.
A lone port which will listen to every interface on that port.
The path to a Unix s_____.
The listen directive can be set to:
An IP address/port combo.
A lone IP address which will then listen on the default port 80.
A lone port which will listen to every interface on that port.
The path to a Unix socket.
The l______ directive can be set to:
An IP address/port combo.
A lone IP address which will then listen on the default port 80.
A lone port which will listen to every i______ on that port.
The p___ to a Unix socket.
The listen directive can be set to:
An IP address/port combo.
A lone IP address which will then listen on the default port 80.
A lone port which will listen to every interface on that port.
The path to a Unix socket.
/etc/n____ The Nginx configuration directory. All of the Nginx configuration files reside here.
/etc/nginx: The Nginx configuration directory. All of the Nginx configuration files reside here.
/etc/nginx/nginx.c____: The main Nginx configuration file. This can be modified to make changes to the Nginx global configuration.
/etc/nginx/nginx.conf: The main Nginx configuration file. This can be modified to make changes to the Nginx global configuration.
/etc/nginx/s___s-a______/: The directory where per-site server blocks can be stored. Nginx will not use the configuration files found in this directory unless they are linked to the sites-enabled directory. Typically, all server block configuration is done in this directory, and then enabled by linking to the other directory.
/etc/nginx/sites-available/: The directory where per-site server blocks can be stored. Nginx will not use the configuration files found in this directory unless they are linked to the sites-enabled directory. Typically, all server block configuration is done in this directory, and then enabled by linking to the other directory.
/etc/nginx/sites-e____ed/: The directory where enabled per-site server blocks are stored. Typically, these are created by linking to configuration files found in the sites-available directory.
/etc/nginx/sites-enabled/: The directory where enabled per-site server blocks are stored. Typically, these are created by linking to configuration files found in the sites-available directory.
/etc/nginx/s______s: This directory contains configuration fragments that can be included elsewhere in the Nginx configuration. Potentially repeatable configuration segments are good candidates for refactoring into snippets.
/etc/nginx/snippets: This directory contains configuration fragments that can be included elsewhere in the Nginx configuration. Potentially repeatable configuration segments are good candidates for refactoring into snippets.
/var/log/nginx/a_____.log: Every request to your web server is recorded in this log file unless Nginx is configured to do otherwise.
/var/log/nginx/access.log: Every request to your web server is recorded in this log file unless Nginx is configured to do otherwise.
/var/log/nginx/e____.log: Any Nginx errors will be recorded in this log.
/var/log/nginx/error.log: Any Nginx errors will be recorded in this log.
command to have all commands recognized as root (elevate session to root)
sudo su -
command to test and see configuration all at once
nginx -T