0

I am trying to use a VirtualHost on my server with mod_proxy to add an authentication layer to another server I am running. The authentication and basic loading work correctly, but a main page requires the use of a different layer 5 protocol, ws:// instead of http://. In the ProxyPass(Reverse) directives, I must supply the layer 5 protocol to use. I have tried not supplying the protocol, supplying two different virtualhosts with the different protocols in the opening tag, e.g.

<VirtualHost http://192.168.192.172:5440>

and

<VirtualHost ws://192.168.192.172:5440>

both of which fail on loading the server. Is there another directive I can add, or a different way of setting up the VirtualHost that will instead work? My current VirtualHost config is:

<VirtualHost *:5440>
    ProxyPass / "http://192.168.192.172:8080"
    ProxyPassReverse / "http://192.168.192.172:8080"
    ProxyPreserveHost On
</VirtualHost>

Thanks in advance!

0

Virtualhost does not work with full url scheme as in your first two examples, Virtualhost just takes ip:port or *:port or even default:port, but don't use names or full url schemes.

Correct examples:

<Virtualhost 192.168.192.172:5440>
<Virtualhost 192.168.192.172:5440 192.168.192.172:5441>
<Virtualhost *:5440>
<VirtualHost _default_:5440>


In the last virtualhost you need to match slashes in ProxyPass, if there is a ending slash in the source, add it to the target, if there is not, don't:

ProxyPass / http://192.168.192.172:8080/
ProxyPassReverse / http://192.168.192.172:8080/

or

ProxyPass /something http://192.168.192.172:8080/something

As for ws, use mod_proxy_wstunnel

for example:

ProxyPass /ws/ ws://192.168.192.172/
ProxyPass /wss/ wss://192.168.192.172/
1
  • Thanks! Informative. but did not solve the problem. It did send me in the right direction, even though I have not solved my issue yet. – Nick Johnson Dec 28 '16 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.