简体   繁体   English

Apache ProxyPass所有请求

[英]Apache ProxyPass all requests

I have Proxy Pass somewhat working. 我的代理通行证有些正常。 I am using it like so 我像这样使用它

ProxyPass     /chorus/   http://localhost:7070/
ProxyPassReverse /chorus/   http://localhost:7070/

This chorus folder does not exist and I am accessing through apache port 80 in the browser. 该合唱文件夹不存在,我正在浏览器中通过apache端口80访问。 Then it redirects to my application running on port 7070 which provides its webpage. 然后,它将重定向到运行在提供其网页的端口7070上的我的应用程序。 The functionality within the webpage does not work though because the javascript starts requesting images and other info as /images/image1.jpg for example or /jsonrpc on apache and isn't going through the proxy. 网页中的功能无法正常运行,因为javascript开始以/images/image1.jpg或apache上的/ jsonrpc的形式请求图像和其他信息,并且未通过代理。 But on port 80 there is no /images because it's part of the :7070 application. 但是在端口80上没有/ images,因为它是:7070应用程序的一部分。 If I do like below it will work too, but there are too many folders, I need a way to set everything returned from 7070 to be processed by apache as http:// localhost:7070/image/... 如果我喜欢下面的方法,它也可以工作,但是文件夹太多,我需要一种方法将7070返回的所有内容都设置为由apache处理为http:// localhost:7070 / image / ...

ProxyPass /jsonrpc   http://localhost:7070/jsonrpc
ProxyPass /image  http://localhost:7070/image

Basically the page for the app loads but the content does not, the app is requesting /jsonrpc which looks something like this (proxied version) 基本上,该应用的页面会加载,但内容不会加载,该应用正在请求/ jsonrpc,它看起来像这样(代理版本)

Remote Address:192.168.1.150:80
Request URL:http://192.168.1.150/jsonrpc?tm=1419196786193
Request Method:POST
Status Code:404 Not Found

When in the app directly without proxy it looks like this 在没有代理的情况下直接进入应用时,它看起来像这样

Remote Address:192.168.1.150:7070
Request URL:http://192.168.1.150:7070/jsonrpc?tm=1419196894248
Request Method:POST
Status Code:200 OK

it's not really something you can fix within the Proxy module, other than by spelling out all possible paths, which you want to avoid; 除了通过拼写要避免的所有可能路径之外,您实际上无法在Proxy模块中解决该问题; your alternatives are: 您的选择是:

  • a. 一种。 change the application and make it proxy aware so that 更改应用程序并使它知道代理,以便
  • b. change the proxy so that your app lives on it's own vhost eg chorus.example.org 更改代理,使您的应用驻留在其自己的虚拟主机上,例如chorus.example.org

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM