-
-
Save elbart/945901 to your computer and use it in GitHub Desktop.
replace nginx with connect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var connect = require('connect') | |
, proxy = require('http-proxy') | |
function redirect(loc) { | |
return connect.createServer(function(req, res){ | |
res.writeHead(301, { "Location": loc }); | |
res.end(); | |
}); | |
} | |
connect( | |
connect.vhost('stuff.jb55.com', connect.createServer(connect.static(__dirname + "/stuff"))), | |
connect.vhost('www.jb55.com', redirect("http://jb55.com/")), | |
connect.vhost('jb55.com', connect.createServer(connect.static(__dirname + "/public"))), | |
connect.vhost('somesite.jb55.com', proxy.createServer(8083, 'localhost')) | |
).listen(80); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment