Re: Configuring mod_proxy_hml and mod_proxy_wstunnel on the same URL (different protocols)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Can someone please tell me is it possible to proxy resources based on protocol?
http://some_url will go to http://localhost:8080/someurl
ws://some_url will go to ws://localhost:8080/someurl



On Thu, Jan 30, 2014 at 12:19 AM, Maxim Solodovnik <solomax666@xxxxxxxxx> wrote:
The following configuration works as expected (css files, images js scripts, json requests are working)
        <Location /openmeetings>
                Order allow,deny
                Allow from all
                ProxyPass http://localhost:5080/openmeetings
                ProxyPassReverse http://localhost:5080/openmeetings
        </Location>

Web socket connection is failed

adding 
        <Location /openmeetings>
                Order allow,deny
                Allow from all
               ProxyPass ws://localhost:5080/openmeetings
               ProxyPassReverse ws://localhost:5080/openmeetings

                ProxyPass http://localhost:5080/openmeetings
                ProxyPassReverse http://localhost:5080/openmeetings

        </Location>

send all requests to ws://* (I guess) So I haven't receive any resources

adding 
        <Location /openmeetings>
                Order allow,deny
                Allow from all
               ProxyPass ws://localhost:5080/openmeetings

                ProxyPass http://localhost:5080/openmeetings
        </Location>
All resources other than html are not working :( (WebSocket connection is made by _javascript_ so I have no idea if it is working or not ...)

I need same URL for http:// and ws://



On Thu, Jan 30, 2014 at 12:10 AM, <yan@xxxxxxxxxx> wrote:
> Hello,
>
> Is it possible to set up proxying of
> http://mysite/openmeetings to http://localhost:5080/openmeetings
> and same time
> ws://mysite/openmeetings to ws://localhost:5080/openmeetings
>
> What I have tried
> Install apache httpd on Ubuntu 13.10 server (2.4.6 using apt-get)
> Checkout
> http://svn.apache.org/repos/asf/httpd/httpd/tags/2.4.7/modules/proxy/mod_proxy_wstunnel.c
> http://svn.apache.org/repos/asf/httpd/httpd/tags/2.4.7/modules/proxy/mod_proxy.h
>
> (2.4.7 sources were used since I got seg faults with 2.4.6)
>
>
> build using
> apxs2 -aic -I/usr/include/libxml2 ./mod_proxy_wstunnel.c
>
> 1) Add following lines to the config:
>
>         <Location /openmeetings>
>                 Order allow,deny
>                 Allow from all
>                 ProxyPass http://localhost:5080/openmeetings
>                 ProxyPassReverse http://localhost:5080/openmeetings
>
>                ProxyPass ws://localhost:5080/openmeetings
>                ProxyPassReverse ws://localhost:5080/openmeetings
>         </Location>
>
> 2) restart apache
>
> perform steps 1 and 2 commenting different lines
> No luck :(

What does "No luck" mean?

This is the setup I am stuggling with....

It (almost) works.  It handles cookies but fails to handle URLs in
_javascript_ (I think).  At least all my _javascript_ content is broken and
some static images fail to load, and I think those are being loaded from
_javascript_. (I did not develop the content, I am just trying to proxy it.)

I'd suggest you get the http proxy working first and then handle the rest.

ProxyHTMLURLMap http://127.0.0.1:8002 /ap/Downstairs
<location /ap/Downstairs>
#       DefaultType text/html
        SetOutputFilter proxy-html
        ProxyHTMLExtended On
        RequestHeader    unset  Accept-Encoding
        ProxyPass http://127.0.0.1:8002/
        ProxyPassReverse http://127.0.0.1:8002
        ProxyHTMLURLMap / /ap/Downstairs/
        ProxyPassReverseCookiePath / /ap/Downstairs/
</location>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




--
WBR
Maxim aka solomax



--
WBR
Maxim aka solomax

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux