---
title: "Discussion on \"Understanding Nginx: Web Server and Proxy Server Capabilities\" | Hashnode"
description: "Discussion on \"Understanding Nginx: Web Server and Proxy Server Capabilities\". Nginx serves as both a web server and a proxy server, with various functions such as load balancing, caching, encryption, compression, and segmentation. As a web server, Nginx primarily serves static content, such as HTML files, images, CSS, and Java..."
url: "https://hashnode.com/posts/understanding-nginx-web-server-and-proxy-server-capabilities/66d8b08b56498e4624936ea9"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Understanding Nginx: Web Server and Proxy Server Capabilities](https://vidhula.com/understanding-nginx-web-server-and-proxy-server-capabilities?utm_source=hashnode&utm_medium=feed)

Nginx serves as both a web server and a proxy server, with various functions such as load balancing, caching, encryption, compression, and segmentation. As a web server, Nginx primarily serves static content, such as HTML files, images, CSS, and Java...

Sep 4, 2024 · 2 min read · vidhula.com  
Updated Apr 14, 2025  
Read the article

-   [#nginx](https://hashnode.com/tag/nginx)
-   [#web-development](https://hashnode.com/tag/web-development)

## Written by

[Vidhula](https://hashnode.com/@vidhula)

@vidhula

  
[View profile](https://hashnode.com/@vidhula)

I am a 2023 graduate from VIT Vellore, specializing in B.Tech in Computer Science Engineering. My experience includes working with technologies such as Java, CI/CD, AWS, SQL, and JUnit. I have recently completed a 6-month internship as a Quality Assurance Engineer at Amazon.

## Responses 1

Markdown supported · ⌘↵ to post

[CDN Edge Ops](https://hashnode.com/@cdnedgeops)

[Oct 31](https://hashnode.com/posts/understanding-nginx-web-server-and-proxy-server-capabilities/66d8b08b56498e4624936ea9/comment/6ae580ce94068dc41316d166)

Treating nginx as both static edge and reverse proxy works best when the location map is explicit: root or alias for fingerprinted assets with long Cache-Control, and a separate proxy\_pass path for the app with Host plus X-Forwarded-For and X-Forwarded-Proto so the origin sees the public scheme. I terminate TLS once at nginx, keep upstream on the private network, and enable keepalive on the upstream block with protocol 1.1 plus an empty Connection header so sockets actually reuse.

For caching I only proxy\_cache idempotent GETs with a cache key that includes the host and a trimmed URI, and I leave authenticated or cookie-bearing responses uncached unless Vary is deliberate. After config changes I compare a direct upstream hit versus the edge path on status, body hash, and cache status headers — a MISS forever usually means an accidental Authorization or Set-Cookie on the response, not a broken zone. Log $upstream\_addr with $upstream\_cache\_status for a day before trusting the dual-role setup in production.
