[英]Issue doing reverse proxy using apache with subdomain
I am trying to do a mod_proxy implementation of a sintra application using a subdirectory uri on the proxy host. 我正在尝试使用代理主机上的子目录uri对sintra应用程序进行mod_proxy实现。 Here is my apache proxy config area:
这是我的Apache Proxy配置区域:
ProxyRequests Off
ProxyPass /api/ http://127.0.0.1:9292/
ProxyPassReverse /api/ http://127.0.0.1:9292/
ProxyPreserveHost on
The problem I am running into, is that the links within the sinatra rendered page are not resulting in the /api prefix on the links... For example, when I do to('/some_page')
within an erb template, it gives me 我遇到的问题是,sinatra呈现的页面中的链接未在链接上产生/ api前缀...例如,当我在erb模板中执行
to('/some_page')
,我
http://www.externalhost.com/some_page
http://www.externalhost.com/some_page
instead of 代替
http://www.externalhost.com/api/some_page
http://www.externalhost.com/api/some_page
Does anyone know how to properly do this where the subdirectory will be honored in generating the url? 有谁知道如何正确执行此操作,以便在生成子目录时使用子目录? To run the backend server, I'm simply using the default as: rackup config.ru where my config is:
要运行后端服务器,我只是简单地使用默认值为:rackup config.ru,其中我的配置是:
require 'rubygems'
load File.join(File.dirname(__FILE__), 'app.rb')
run App
ProxyRequests Off
ProxyPass /api/ http://127.0.0.1:9292/api/
ProxyPassReverse /api/ http://127.0.0.1:9292/api/
ProxyPreserveHost on
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.