Skip to main content
Web Engineering

Mastering Linux Networking: Nginx Reverse Proxy Architecture & Zero-Downtime Migration

A practical guide to configuring Nginx, SSL termination, and seamless container routing on modern Ubuntu.

Makhlwf
5 min read
Updated Nov 4, 2026

Modern Reverse Proxy Patterns #

When operating services on Ubuntu, Nginx serves as the frontline guardian. It handles TLS termination, HTTP/2 multiplexing, rate limiting, and request forwarding.

Upstream Proxy Configuration #

nginx
# /etc/nginx/conf.d/makhlwf-proxy.conf
upstream blog_upstream {
    server 127.0.0.1:3000;
    keepalive 32;
}

server {
    listen 443 ssl http2;
    server_name makhlwf.ly www.makhlwf.ly;

    ssl_certificate /path/to/fullchain.pem;
    ssl_certificate_key /path/to/privkey.pem;

    location / {
        proxy_pass http://blog_upstream;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Key Hardening Directives #

  1. Strict Transport Security (HSTS): Guarantees clients never downgrade to unencrypted HTTP.
  2. X-Content-Type-Options: nosniff: Prevents MIME-sniffing exploits on user uploads.
  3. Permissions-Policy: Restricts unnecessary browser hardware APIs.
Share:PostShareTelegram
M

Published by Makhlwf

A five years junior engineer. specialized in Python, C# and website designing.