This project implements a simple reverse proxy which distributes the requests according to the hostname.
We use it to build demonstrators on virtual machines running different servers of a distributed system.
The project is widely based on node-http-proxy
More information on EBU developments
Ensure your system has Node.js and NPM installed.
$ git clone https://github.com/ebu/http-reverseproxy.git
$ cd http-reverseproxy
$ npm install
Edit config.dist.js and rename it to `config.js to run the server
$ npm start
var config = {
listening_port: 80,
https: {
listening_port: 443,
key: '', // SSL Private key
cert: '' // SSL Public certificate
},
backend_servers: [
{
'local_port': 8080,
'origin_host': 'www.ebu.io'
},
{
'local_port': 8081,
'origin_host': 'bbc1.ebu.io'
},
{
'local_port': 8082,
'origin_host': 'bbc2.ebu.io'
}
],
fallback_port: 8090 | null,
error_message: 'The system is down.\n\n2014 - EBU Technology & Innovation - ebu.io'
};
module.exports = config;
listening_port - Listening port of the reverse proxy
https - It enables SSL support on https.listening_port using the private key key and the public certificate cert
backend_servers - The request are distributed according to the origin_host to the local port.
fallback_port - If no backend_servers rules match the request, the request will be sent to this local port if different than null.
Otherwise an error_message is returned with a status code 500.
error_message - Message sent in case of error (ie Backend server doesn't respond.)
- Michael Barroco (EBU)
Copyright (c) 2014, EBU-UER Technology & Innovation
The code is under BSD (3-Clause) License. (see LICENSE.txt)