0

using sec-web httpd. the python code has api: host/v0/auth/sessions/blablba... the java code has api: host/v0/auth/users/blabla.... there is a conf file on the machine which have the following for the python api:

 ProxyPass                    /v0/auth/sessions http://localhost:8098/v0/auth/sessions
 ProxyPassReverse     /v0/auth/sessions http://localhost:8098/v0/auth/sessions

and for the java api:

ProxyPass               /   ajp://localhost:8009/
ProxyPassReverse        /   ajp://localhost:8009/

now: when I'm accessing the python api I'm getting good response, but when trying to access the java api I/m getting '[]' - the status code is 200 but I'm supposed to get a different response.

any idea?

4

2 回答 2

0

我有类似的任务,我将以下 apache 配置文件放入 java 应用程序的配置中:

NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin "mail@example.com"
    ServerName example.com
    ServerAlias www.example.com`

    ProxyRequests off
    ProxyPreserveHost on

    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    ProxyPass / http://127.0.0.1:8080/
    ProxyPassReverse / http://127.0.0.1:8080/
    <Location />
         Order allow,deny
         Allow from all
    </Location>

</VirtualHost>

请注意http://example.com:8080/打开 java 应用程序。它不是http://example.com:8080/app/。Java 应用程序作为 ROOT.jar 放置在 /var/lib/tomcat7/webapps/ 目录的根目录中(对于我的 tomcat)。

于 2013-01-30T11:33:21.587 回答
0

在我们的服务器中,我们运行 Apache 作为代理服务器,这里是示例,希望对您有所帮助。

<IfModule mod_proxy.c>
ProxyRequests On
ProxyVia On


<Proxy http://localhost:8080/service>
        AddDefaultCharset off
        Order allow,deny
        Allow from all
</Proxy>

<Proxy http://localhost:8080/foo>
        AddDefaultCharset off
        Order allow,deny
        Allow from all
</Proxy>


<Location "/service">

    Order deny,allow
    Deny from all

    ProxyPass http://localhost:8080/service
    ProxyPassReverse http://localhost:8080/service
</Location>

<Location "/foo">

    Order deny,allow
    Deny from all

    ProxyPass http://localhost:8080/foo
    ProxyPassReverse http://localhost:8080/foo
</Location>

</IfModule>
于 2013-06-12T11:11:13.320 回答