Recall & Review
beginner
What is the purpose of the
proxy_pass directive in nginx?The
proxy_pass directive tells nginx to forward client requests to another server or service, acting as a middleman to pass requests and responses.Click to reveal answer
beginner
How do you use
proxy_pass to forward requests to http://localhost:8080?Inside an nginx
location block, write: <br>proxy_pass http://localhost:8080;This sends matching requests to the server running on port 8080 on the same machine.
Click to reveal answer
intermediate
What happens if you omit the trailing slash in
proxy_pass URL?If the URL in
proxy_pass does not end with a slash, nginx replaces the matching part of the request URI with the URL path. This can change the request path sent to the backend.Click to reveal answer
beginner
Can
proxy_pass be used to forward requests to an HTTPS backend?Yes, you can use
proxy_pass https://backend-server; to forward requests securely to an HTTPS backend server.Click to reveal answer
intermediate
What directive is commonly used with
proxy_pass to set the original host header?The directive
proxy_set_header Host $host; is often used with proxy_pass to pass the original host header to the backend server.Click to reveal answer
What does the
proxy_pass directive do in nginx?✗ Incorrect
proxy_pass forwards requests to another server or service, acting as a reverse proxy.
Which of the following is a correct
proxy_pass usage to forward to http://example.com?✗ Incorrect
The URL must include the scheme like http:// or https://.
What is the effect of adding a trailing slash to the URL in
proxy_pass?✗ Incorrect
A trailing slash changes how nginx modifies the request URI when forwarding.
Can
proxy_pass forward requests to an HTTPS backend?✗ Incorrect
Using https:// in the proxy_pass URL forwards requests securely.
Which directive is used to pass the original host header to the backend when using
proxy_pass?✗ Incorrect
proxy_set_header Host $host; passes the original host header to the backend server.
Explain how the
proxy_pass directive works in nginx and why it is useful.Think about nginx acting like a middleman between clients and backend servers.
You got /4 concepts.
Describe the difference in behavior when using a trailing slash versus no trailing slash in the
proxy_pass URL.Focus on how nginx changes the request path sent to the backend.
You got /4 concepts.