Reverse Proxy & Load Balancing in Apache
From the Apache cheat sheet · Reverse Proxy · verified Jul 2026
Reverse Proxy & Load Balancing
Forward requests to Node.js, Python, or other backend servers
apacheconf
# Enable required modules
sudo a2enmod proxy proxy_http proxy_balancer lbmethod_byrequests
# Basic reverse proxy
<VirtualHost *:80>
ServerName app.example.com
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
</VirtualHost>💡 ProxyPreserveHost On sends the original Host header to the backend — essential for virtual hosts
⚡ Use ProxyPass /path ! to exclude paths from proxying (serve static files directly)
📌 WebSocket proxying needs mod_proxy_wstunnel and RewriteRule for the Upgrade header
🟢 Load balancing with BalancerMember distributes traffic across multiple backend instances
proxyreverse-proxyload-balancing