NGINX Flashcards

1
Q

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_______.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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_____.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

NGINX’s configuration files end with the .c___ extension

A

NGINX’s configuration files end with the .conf extension

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

You can restart the NGINX service by executing the sudo s____ restart nginx command.

A

You can restart the NGINX service by executing the sudo systemctl restart nginx command.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Technically, everything inside a NGINX configuration file is a d_____. D______s are of two types:

Simple D______s
Block D_______s

A

Technically, everything inside a NGINX configuration file is a directive. Directives are of two types:

Simple Directives
Block Directives

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Nginx uses a common practice called symbolic links, or symlinks, to track which of your server b____s are enabled.

A

Nginx uses a common practice called symbolic links, or symlinks, to track which of your server blocks are enabled.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Nginx uses a common practice called symbolic links, or s_____, to track which of your server blocks are enabled.

A

Nginx uses a common practice called symbolic links, or symlinks, to track which of your server blocks are enabled.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

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.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

This environment variable automatically expands to the current user’s username

A

$USER: This environment variable automatically expands to the current user’s username

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

In order for Nginx to serve this content, it’s necessary to create a server block with the correct d_______s

A

In order for Nginx to serve this content, it’s necessary to create a server block with the correct directives

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Instead of modifying the default configuration file directly, let’s make a new one with sudo nano /etc/nginx/s___s-a_______/your_domain

A

Instead of modifying the default configuration file directly, let’s make a new one at /etc/nginx/sites-available/your_domain

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

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_____.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

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.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

/etc/n____ The Nginx configuration directory. All of the Nginx configuration files reside here.

A

/etc/nginx: The Nginx configuration directory. All of the Nginx configuration files reside here.

17
Q

/etc/nginx/nginx.c____: The main Nginx configuration file. This can be modified to make changes to the Nginx global configuration.

A

/etc/nginx/nginx.conf: The main Nginx configuration file. This can be modified to make changes to the Nginx global configuration.

18
Q

/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.

A

/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.

19
Q

/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.

A

/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.

20
Q

/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.

A

/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.

21
Q

/var/log/nginx/a_____.log: Every request to your web server is recorded in this log file unless Nginx is configured to do otherwise.

A

/var/log/nginx/access.log: Every request to your web server is recorded in this log file unless Nginx is configured to do otherwise.

22
Q

/var/log/nginx/e____.log: Any Nginx errors will be recorded in this log.

A

/var/log/nginx/error.log: Any Nginx errors will be recorded in this log.

23
Q

command to have all commands recognized as root (elevate session to root)

A

sudo su -

24
Q

command to test and see configuration all at once

A

nginx -T

25
Q

command to view configure settings (without opening them)

A

view nginx.conf

26
Q

this directive defines groups of servers that can be referenced by other directives

A
upstream example {
  server a.example.com:8001
  server b.example.com:8002
}
27
Q

Where can logs be configured in NGINX configurations?

A

in the http, server, and location contexts
Logging configuration is not limited to the server context.

28
Q

Upstreams must be defined in the _____ context

A

Upstreams must be defined in the http context

29
Q

NGINX uses __ files to record various operational details like the date, time, and name of a file that was served. These ___s are useful for monitoring normal operation and tracking down issues if a problem occurs.

A

NGINX uses log files to record various operational details like the date, time, and name of a file that was served. These logs are useful for monitoring normal operation and tracking down issues if a problem occurs.

30
Q

Which directive is used to influence load balancing methods?

A

weight

least_conn is a load balancing method but does not affect other methods.

31
Q

What is the main difference between configuring a reverse proxy and a load balancer in NGINX?

A

the number of servers in the upstream used by a proxy_pass directive &
No additional logging is required for load balancers.

32
Q

What are location directive useful for?

A

1) configuring NGINX to process different requests in ways similar to server blocks without having to
create additional servers
2) extending an NGINX configuration based on the URI being processed by the server

33
Q

The upstream directive is one of the key components used to configure NGINX for proxying and load balancing. The upstream directive groups servers together, allowing other directives to reference all of the servers as a single unit

A

The upstream directive is one of the key components used to configure NGINX for proxying and load balancing. The upstream directive groups servers together, allowing other directives to reference all of the servers as a single unit

34
Q

The t.._f___s directive gives NGINX a list of files or directories to look for, relative to the location. The first file or directory that matches gets processed. If no items in the list match, then the last item in the list is used as a URI or an error code

A

The try_files directive gives NGINX a list of files or directories to look for, relative to the location. The first file or directory that matches gets processed. If no items in the list match, then the last item in the list is used as a URI or an error code