1. When to use it
Useful when you want to place a standard port or a more convenient logging layer in front of an internal service.
nginx | reverse proxy | proxy_pass | backend | test
2. Base setup
cat > /etc/nginx/nginx.conf <<'EOF'
http {
server {
listen 80;
location / {
proxy_pass http://127.0.0.1:8080;
}
}
}
EOF
nginx -t
/etc/rc.d/rc.nginx restart
Adjust host names, IPs, interfaces, paths, and versions to the real system before making the change persistent.
3. Quick verification
curl -I http://127.0.0.1/
ss -lntp | grep ':80'
grep -n 'proxy_pass' /etc/nginx/nginx.conf
Confirm that the output matches the expected state before considering the intervention complete.
4. Operational notes
In real environments forward Host and X-Forwarded-* headers too, otherwise backends see incomplete context.
Quick checklist
[ ] Steps completed\n[ ] Config updated\n[ ] Tests executed\n[ ] Rollback ready\n[ ] Logs checked