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 #
- Strict Transport Security (HSTS): Guarantees clients never downgrade to unencrypted HTTP.
- X-Content-Type-Options: nosniff: Prevents MIME-sniffing exploits on user uploads.
- Permissions-Policy: Restricts unnecessary browser hardware APIs.
M
Published by Makhlwf
A five years junior engineer. specialized in Python, C# and website designing.