我正在尝试在另一个 nodejs/express 应用程序的子目录中设置 Ghost 博客程序 (v0.4)。我能够按照此处概述的步骤使其工作:Node http-proxy and express
因此,我通过 Express 从我的主应用程序将代理设置为 Ghost,如下所示(在我的开发机器上):'
var proxy = new httpProxy.createProxyServer();
server.get('/blog*', function (req, res, next) {
proxy.web(req, res, {
target: 'http://localhost:2368'
});
});
这可以访问博客内容。但是,当我去 /blog/ghost/signin 并尝试登录时,我得到一个 404。据我所知,登录页面不会出现在 blog/ 目录之外的任何地方,那为什么会失败呢?
如果我直接查看博客(在端口 2368 上),我可以正常登录。