Gist 4985633
✓ Published0🌍 Public
Aalessioalex
Last edited May 27, 2012
Created on Feb 19, 2013
This example demonstrates a multi-domain HTTP/HTTPS reverse proxy server built with Node.js and the `http-proxy` module. It routes incoming requests to distinct backend applications based on the requested hostname, with separate configurations for `www1.localhost` and `www2.localhost`. The server uses `crypto.createCredentials` for HTTPS SNI callbacks, enabling per-domain TLS certificates. Each backend app, defined in separate files like `www1_app.js`, responds with a plain-text message confirming the successful proxy and echoing request headers, illustrating how the proxy handles both HTTP and HTTPS traffic across multiple virtual hosts.
AI-generated description