Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将heroku应用程序反向代理到wordpress博客_Wordpress_Heroku_Reverse Proxy - Fatal编程技术网

将heroku应用程序反向代理到wordpress博客

将heroku应用程序反向代理到wordpress博客,wordpress,heroku,reverse-proxy,Wordpress,Heroku,Reverse Proxy,我已经在config.ru中设置了heroku应用程序的反向代理 require ::File.expand_path('../config/environment', __FILE__) use Rack::ReverseProxy do reverse_proxy /^\/blog(.*)$/, 'http://blog.domain.com$1', opts={:preserve_host => true} end run Appname::Application 这允

我已经在config.ru中设置了heroku应用程序的反向代理

require ::File.expand_path('../config/environment',  __FILE__)
use Rack::ReverseProxy do  
   reverse_proxy /^\/blog(.*)$/, 'http://blog.domain.com$1', opts={:preserve_host => true}
end
run Appname::Application
这允许我的heroku应用程序在domain.com上运行,并在wordpress站点被服务于blog.domain.com时将domain.com/blog显示为URL。到目前为止很好

当我访问domain.com/blog时,wordpress站点得到了正确的服务,但是当我访问任何更深的页面时,比如某篇文章wordpress抛出了一个错误。我使用的是带有日期和标题的permalinks,其URL格式为:domian.com/blog/2012/07/a-great-blog-post-Worpress,但现在看来不太像这样。当我将链接切换回domain.com/blog/?p=4格式时,页面被成功送达

它似乎无法正确处理inial domain.com/blog后面的斜杠。我觉得奇怪的是domain.com/blog/wp-admin(以及整个wp-admin应用程序)工作时没有任何问题

任何人都能看到为什么带有多个斜杠“/”的页面/帖子可能会引起问题的突出问题吗


提前谢谢

我找到了一个解决方案,无论出于什么原因,在永久链接的WP设置中,它都不喜欢任何默认选项,除了可以通过id检索帖子的表单(http://www.domain.com/blog/?p=123)

出于搜索引擎优化的目的,我希望文章的标题出现在URL中。因此,我在“自定义结构”字段中输入: /index.php/%postname%/


wordpress似乎需要index.php来正确处理路由。

这是Apache可能抛出的错误:内部服务器错误服务器遇到内部错误或配置错误,无法完成您的请求。请与服务器管理员联系,root@localhost并告知他们错误发生的时间,以及您可能采取的任何可能导致错误的措施。关于这个错误的更多信息可以在服务器错误日志中找到。我使用了rack reverse proxy,new relic告诉我请求在那里花费了很多时间,我现在正在尝试坏的事情是unicorn解释了这一点,而今天puma是推荐的服务器。