Recall & Review
beginner
What is a reverse proxy in the context of web servers?
A reverse proxy is a server that sits between clients and backend servers. It receives client requests and forwards them to the backend server, then sends the server's response back to the client. It helps with load balancing, security, and hiding backend details.
Click to reveal answer
beginner
Why use Nginx as a reverse proxy for a Flask application?
Nginx can handle many client connections efficiently, serve static files quickly, and forward dynamic requests to the Flask app. It improves performance, security, and allows running Flask on a local port hidden from the internet.
Click to reveal answer
intermediate
Which Nginx directive is used to forward requests to the Flask backend?
The proxy_pass directive is used inside a location block to forward client requests to the Flask backend server running on a specific address and port.
Click to reveal answer
intermediate
How does Nginx improve security when used as a reverse proxy?
Nginx can hide the backend server's IP and details, filter bad requests, limit request rates, and handle SSL/TLS encryption. This protects the Flask app from direct attacks and improves overall security.
Click to reveal answer
beginner
What is a common port configuration when using Nginx as a reverse proxy for Flask?
Nginx listens on port 80 (HTTP) or 443 (HTTPS) for client requests, while Flask runs on a local port like 5000. Nginx forwards requests from port 80/443 to Flask's port 5000 internally.
Click to reveal answer
What role does Nginx play when used as a reverse proxy for Flask?
✗ Incorrect
Nginx forwards client requests to the Flask backend and sends back the responses, acting as a middleman.
Which Nginx directive forwards requests to the Flask server?
✗ Incorrect
The proxy_pass directive tells Nginx where to send the incoming requests.
Why is it better to run Flask behind Nginx instead of exposing Flask directly?
✗ Incorrect
Nginx is optimized for handling many connections and adds security features that Flask alone does not provide.
What port does Nginx usually listen on when acting as a reverse proxy for Flask?
✗ Incorrect
Nginx listens on standard web ports 80 (HTTP) or 443 (HTTPS) and forwards requests to Flask's port.
How does Nginx help with SSL/TLS when used as a reverse proxy?
✗ Incorrect
Nginx handles SSL encryption and then forwards unencrypted requests to Flask, simplifying Flask's setup.
Explain how Nginx acts as a reverse proxy for a Flask application and why this setup is useful.
Think about Nginx as a middleman between users and your Flask app.
You got /5 concepts.
Describe the key Nginx configuration directives needed to set up a reverse proxy for Flask.
Focus on how Nginx forwards requests to Flask.
You got /4 concepts.