Process Flow - Gzip compression
Client sends HTTP request
Nginx receives request
Check if gzip is enabled?
No→Send response uncompressed
Yes
Compress response with gzip
Add Content-Encoding: gzip header
Send compressed response to client
Nginx checks if gzip compression is enabled for the response. If yes, it compresses the response and adds the proper header before sending it to the client.