MSNCodeSNIPPETS← msncode.dev
snippets/nginx

Reverse Proxy to Backend

Forward requests to a backend server

nginxnginxproxybackend
NGINX
location /api/ {
  proxy_pass http://localhost:3000/;
}

More nginx snippets

Custom 404 Page

Serve a custom error page for 404s

Enable Gzip Compression

Compress responses to reduce bandwidth

Redirect HTTP to HTTPS

Force all traffic to use HTTPS

Serve Static Files

Serve static files from a directory