我在服务器上使用Bouncy。但它不适用于子域。
我的剧本:
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);
当我访问www.example.com
时,我看到了我的页面。但是,当我访问sub.example.com
永远扔我错误
error: Forever detected script was killed by signal: SIGKILL
error: Script restart attempt #1
谁知道如何解决这个问题?