HTTP绑定的代理/网关

HTTP绑定的代理/网关,http,proxy,xmpp,Http,Proxy,Xmpp,我有以下基础设施,希望使用运行Openfire服务器的内部xmpp服务器(服务器2)提供在线web聊天(在服务器1上) 广域网服务器1服务器2 服务器1只能通过HTTP代理到达服务器2。因此,我需要在服务器1上获得HTTP绑定或其他东西,它为JWChat或Co等web聊天提供绑定。 我认为简单地重定向到服务器2上的HTTP绑定会很好,但我不知道如何重定向 也许还有另一种可能性,谢谢你的建议 编辑: nginx的配置如下所示: server { listen 8000;

我有以下基础设施,希望使用运行Openfire服务器的内部xmpp服务器(服务器2)提供在线web聊天(在服务器1上)

广域网服务器1服务器2

服务器1只能通过HTTP代理到达服务器2。因此,我需要在服务器1上获得HTTP绑定或其他东西,它为JWChat或Co等web聊天提供绑定。
我认为简单地重定向到服务器2上的HTTP绑定会很好,但我不知道如何重定向

也许还有另一种可能性,谢谢你的建议

编辑:
nginx的配置如下所示:

server {
    listen       8000;
    server_name  server1 localhost;

    location ~ ^/http-bind {
        proxy_pass http://server2:8085;
    }

    location / {
        proxy_pass http://proxy:3128;
    }
}
但以下命令无法正常工作:

-bash-4.1# wget http://localhost:8000
--2012-02-06 10:57:14--  http://localhost:8000/
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:8000... connected.
HTTP request sent, awaiting response... 400 Bad Request
2012-02-06 10:57:14 ERROR 400: Bad Request.

-bash-4.1# wget http://localhost:8000/http-bind
--2012-02-06 10:57:21--  http://localhost:8000/http-bind
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:8000... connected.
HTTP request sent, awaiting response... 502 Bad Gateway
2012-02-06 10:57:21 ERROR 502: Bad Gateway.

怎么了?

服务器1通常会运行:

  • 代理人
  • 运行您的聊天应用程序的Web服务器
  • 让我们假设nginx是在端口80上运行的代理,您可以选择在端口8080上运行的web服务器。还假设您的web客户端将绑定到
    /http bind
    。然后,您的nginx配置将包含:

        server {
            listen       80;
            server_name  server1;
    
            location ~ ^/http-bind {
                proxy_pass http://server2:5280;
            }
    
            location / {
                proxy_pass http://localhost:8080/;
            }
    
        }
    

    相应地适应其他代理。

    我可以配置nginx,使其使用代理到达服务器2吗?当然,nginx将只代理到其他代理。这并不是问题的关键,但是你可以,但是nginx必须使用代理才能到达服务器2。这很好。nginx也是一个代理,如果您依赖其他代理到达服务器2,您可以这样做。如果你可以依靠nginx扮演这个角色,你就不需要第二个了。我没有机会转换。我必须使用内部代理才能访问服务器2,我无法更改此设置。:)有了谷歌,我找不到关于这个用例的很多细节。