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 ws://>

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 / ""
    ProxyPassReverse / ""
    ProxyPreserveHost On

Thanks in advance!


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 *: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 /
ProxyPassReverse /


ProxyPass /something

As for ws, use mod_proxy_wstunnel

for example:

ProxyPass /ws/ ws://
ProxyPass /wss/ wss://
  • 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.