I'm using Bouncy on my server. But it not works with subdomains.
My script:
var bouncy = require('bouncy');
var server = bouncy(function (req, res, bounce) {
if (req.headers.host === 'www.example.com') {
bounce(8001);
} else if (req.headers.host === 'sub.example.com') {
bounce(8002);
} else {
res.statusCode = 404;
res.end('no such host');
}
});
server.listen(80);
When I visit www.example.com
I see my page. But when I visit sub.example.com
Forever throw me error
error: Forever detected script was killed by signal: SIGKILL
error: Script restart attempt #1
Who knows how to solve this issue?