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).
- The entire service has been restarted. Client's connection to the server might get dropped.
- The Nginx service reloads configurations without stopping the server.
- On syntax error, the server would not recover after restarted.
- That method, not only the master process is being restarted, but also the workers.
Question 2
A Nginx server is running on a VM with 4 CPUs. How many workers it is advisable to be run?
- 1
- 4
- 8
- There is no any thumb rule.
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:
-
/etc/nginx/nginx.conf
-
/etc/nginx/conf.d/default.conf
-
/etc/nginx/nginx-custom.conf
-
/var/run/nginx/nginx.conf
- None of the above
Question 4
How many workers are currently running ?
- 1
- 2
- 3
- 4
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?
- Nginx machine's IP
- The client's IP
-
localhost
- None of the above