DevOpsTheHardWay

Webservers - Nginx - self-check questions

Question 1

Server administrator made some changes to the Nginx main configuration file (/etc/nginx/nginx.conf). Then performed sudo systemctl restart nginx. Choose the correct sentence(s).

Question 2

A Nginx server is running on a VM with 4 CPUs. How many workers it is advisable to be run?

Given the below output of Nginx service status:

● nginx.service - nginx - high performance web server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2022-04-01 09:29:38 UTC; 29min ago
       Docs: https://nginx.org/en/docs/
    Process: 440 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx-custom.conf (code=exited, status=0/SUCCESS)
   Main PID: 479 (nginx)
      Tasks: 3 (limit: 1111)
     Memory: 4.1M
        CPU: 15ms
     CGroup: /system.slice/nginx.service
             ├─479 "nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx-custom.conf"
             ├─480 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
             └─481 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""

Answer the below 2 questions.

Question 3

Which of the following config files the server admin should edit in order to change the server's configurations:

Question 4

How many workers are currently running ?

Question 5

Given the below reverse proxy configuration:

server {
    listen 80;
    server_name example.com;

    location / {
        proxy_pass http://localhost:8080;
    }
}

If a client sends an HTTP request to a web application (Flask) that is behind a reverse proxy (Nginx), which IP address will the web application see as the source of the request?

license