Tag: redbird

反向代理子域到同一台机器上的不同端口将引发404

我尝试过像红redbird这样的手: var proxy = require('redbird')({port: 80}); proxy.register("http://www.example.com", "http://36.154.99.115:3000"); proxy.register("http://abc.example.com", "http://36.154.99.115:3001"); proxy.register("http://xyz.example.com", "http://36.154.99.115:3002"); 和redwire如: var RedWire = require('redwire'); proxy = new RedWire({http: { port: 80 }}); proxy.http("http://www.example.com", "http://36.154.99.115:3000"); proxy.http("http://abc.example.com", "http://36.154.99.115:3001"); proxy.http("http://xyz.example.com", "http://36.154.99.115:3002"); 我可以打http://36.154.99.115:3000和http://36.154.99.115:3003成功加载各自的网页,但是当我尝试击中http://www.example.com ,我得到的是404 host not found 。 我在控制台上得到以下日志: {"name":"redbird","hostname":"ip-172-31-23-160","pid":3239,"level":30,"msg":"Proxying www.example.com/ to www.example.com:3000/","time":"2017-02-12T08:07:57.540Z","v":0} 看起来像成功,但它实际上不起作用… 运行在3000,3001和3002上的服务器正在使用DietJS 注意:我尝试了proxy.register("http://www.example.com", "http://www.facebook.com") ,它工作。

使用SSL的基本Redbird反向代理在Ubuntu Server 14.04上不起作用

这工作,通过去https://sensorypanel.nettesting: var fs = require('fs'); var http = require('http'); http.createServer(function(req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); }).listen(80, '0.0.0.0'); var https = require('https'); var options = { key: fs.readFileSync('certs/sensorypanel.net/sensorypanel_net-key.pem'), cert: fs.readFileSync('certs/sensorypanel.net/sensorypanel_net.crt'), ca: fs.readFileSync('certs/ca_bundle.crt') }; https.createServer(options, function(req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello SSL World\n'); }).listen(443, '0.0.0.0'); 但是使用Redbird作为反向代理,这不起作用: var redbird = require('redbird'), http = require('http'); var […]