Servidor Apache: proxy reverso e websockets via mod_proxy_wstunnel

2

Eu tenho um pequeno problema com os sockets web e meu proxy reverso apache, eu atualizei na última versão 2.4.5 e carreguei o módulo mod_proxy_wstunnel.

O httpd.conf:

     <VirtualHost *:80> 
ServerAdmin webmaster@localhost 
ServerName www.toto.fr 
ServerAlias toto.fr


    ProxyPass /my_app  http://1X.X.X.1:8080/my_app 
    ProxyPassReverse /web_pmr  http://1X.X.X.1:8080/my_app 
    ProxyPassReverseCookiePath /my_app / 
    ProxyPassReverseCookieDomain localhost my_app 
    ProxyRequests off 
    ProxyTimeout 15

        #WEBSOCKETS


        ProxyPass /my_app/BasicWebsocketServlet ws://1X.X.X.1:8080/my_app/BasicWebsocketServlet retry=0 
    ProxyPassReverse /my_app/BasicWebsocketServlet ws://1X.X.X.1:8080/web_pmr/BasicWebsocketServlet retry=0


ErrorLog "logs/my_app_error.log" 
LogLevel debug 
CustomLog "logs/my_app_access.log" combined 

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

Quando eu testo no meu url local, os websockets estão funcionando, mas com o proxy reverso apache no trace nos logs do tomcat.

Lista de módulos carregados:

Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_event_module (static) authn_file_module (shared) authn_core_module (shared) authz_host_module (shared) authz_groupfile_module (shared) authz_user_module (shared) authz_core_module (shared) access_compat_module (shared) auth_basic_module (shared) filter_module (shared) mime_module (shared) log_config_module (shared) env_module (shared) headers_module (shared) setenvif_module (shared) version_module (shared) proxy_module (shared) proxy_connect_module (shared) proxy_ftp_module (shared) proxy_http_module (shared) proxy_fcgi_module (shared) proxy_scgi_module (shared) proxy_fdpass_module (shared) proxy_wstunnel_module (shared) proxy_ajp_module (shared) proxy_balancer_module (shared) proxy_express_module (shared) slotmem_shm_module (shared) slotmem_plain_module (shared) ssl_module (shared) lbmethod_byrequests_module (shared) lbmethod_bytraffic_module (shared) lbmethod_bybusyness_module (shared) lbmethod_heartbeat_module (shared) unixd_module (shared) status_module (shared) autoindex_module (shared) dir_module (shared) alias_module (shared) rewrite_module (shared)

Obrigado.

    
por WhatsUp 15.07.2013 / 12:04

1 resposta

3

Trailing barra deve ser adicionado ao caminho, é necessário para lidar com solicitações de web socket como solicitações GET ( link )

algo como:

ProxyPass        /my_app/BasicWebsocketServlet/ ws://1X.X.X.1:8080/my_app/BasicWebsocketServlet/ retry=0
ProxyPassReverse /my_app/BasicWebsocketServlet/ ws://1X.X.X.1:8080/web_pmr/BasicWebsocketServlet/ retry=0
    
por 12.11.2013 / 11:46