【发布时间】:2015-06-20 02:56:38
【问题描述】:
我在 www.example.com 上的 heroku 上托管了一个 nodejs 应用程序 然后我有一个 wordpress 博客,目前在一个子域上 - blog.example.com
我在 express 中有一个路线设置:
var proxy = require('express-http-proxy');
app.use('/blog', proxy('blog.example.com', {
forwardPath: function(req, res) {
return require('url').parse(req.url).path;
}
}));
这很有效,因为我可以在 www.example.com/blog 上看到博客“主页” - 它正确代理并且对 blog.example.com 透明
但是,如果我访问那里的任何博客文章,它会因 500 错误而崩溃
[error] [client (ipAddressHere)] 由于可能的配置错误,请求超出了 10 个内部重定向的限制。如有必要,使用“LimitInternalRecursion”增加限制。使用'LogLevel debug'获取回溯。,referer:http://www.example.com/blog/
我怀疑这与我的 htaccess 有关 - 但不知道是什么?
我的 htaccess 是:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
# END WordPress
【问题讨论】:
标签: node.js wordpress .htaccess express proxy