Which statement best describes the primary role of Nginx when used as a web server?
Think about what a web server does when a user visits a website.
Nginx as a web server mainly serves static files like images and HTML. It also forwards dynamic requests to application servers that handle the business logic.
Given the following Nginx configuration snippet, what will be the result when a client requests /app?
location /app {
proxy_pass http://127.0.0.1:8080;
}Look at the proxy_pass directive and its target address.
The proxy_pass directive tells Nginx to forward matching requests to the specified backend server, here at localhost port 8080.
When Nginx is configured to proxy requests to an application server, clients sometimes get a 502 Bad Gateway error. What is the most likely cause?
Think about what happens if Nginx cannot connect to the backend server.
A 502 Bad Gateway error means Nginx tried to contact the application server but failed, often because the server is down or unreachable.
Which sequence correctly describes the steps to configure Nginx as a reverse proxy for an application server running on port 5000?
Think about installing software before configuring it and starting services.
You first install Nginx, then start the application server, configure Nginx to proxy requests, and finally restart Nginx to apply changes.
Which practice improves performance and reliability when using Nginx as a web server in front of an application server?
Consider how caching can reduce load and speed up responses.
Serving static files with Nginx and caching dynamic responses reduces load on the application server and improves response times.