0
0
Expressframework~5 mins

Nginx as reverse proxy in Express - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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 an Express app?
Nginx can handle many client connections efficiently, serve static files quickly, provide SSL termination, and forward requests to the Express app. This improves performance, security, and scalability.
Click to reveal answer
intermediate
Which Nginx directive is used to forward requests to the Express backend?
The proxy_pass directive is used inside a location block to forward client requests to the Express backend server.
Click to reveal answer
intermediate
How does Nginx improve security when used as a reverse proxy?
Nginx can hide backend server details, filter requests, limit request rates, and handle SSL/TLS encryption. This protects the Express app from direct exposure to the internet.
Click to reveal answer
beginner
What is the role of the location block in Nginx reverse proxy configuration?
The location block defines which URL paths Nginx should match and how to handle those requests, such as forwarding them to the Express backend using proxy_pass.
Click to reveal answer
What does the proxy_pass directive do in Nginx?
ABlocks client requests
BForwards client requests to a backend server
CServes static files directly
DStarts the Express server
Which benefit does Nginx provide when acting as a reverse proxy for Express?
AHandles SSL termination and load balancing
BImproves client-side JavaScript performance
CReplaces Express entirely
DRuns database queries
Where in the Nginx config do you specify the backend server URL?
AInside <code>server_name</code>
BInside <code>listen</code>
CInside <code>error_page</code>
DInside <code>location</code> with <code>proxy_pass</code>
What port does Express usually listen on when behind Nginx reverse proxy?
A3000 or another custom port
B443
C80
D22
Which of these is NOT a reason to use Nginx as a reverse proxy?
AServe static files efficiently
BLoad balance multiple backend servers
CDirectly run Express code
DImprove security by hiding backend
Explain how Nginx acts as a reverse proxy for an Express app and why it is useful.
Think about what Nginx does before the request reaches Express.
You got /5 concepts.
    Describe the key parts of an Nginx configuration to set up a reverse proxy for Express.
    Focus on the directives inside server and location blocks.
    You got /4 concepts.