Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Apache Reverse http:// proxy being hijacked by ws:// |
|
Author |
|
matty87a
Joined: 03 Aug 2017 Posts: 1
|
Posted: Thu 03 Aug '17 16:51 Post subject: Apache Reverse http:// proxy being hijacked by ws:// |
|
|
I have had apache reverse proxy working fine for a while, however one of the items I proxy too now requires ws:// rtaher than http://
I have added in the config for this and it works, however it then hijacks all other redirects.
For example:
If I access a standard http:// -> http:// proxy (e.g target2 below) - this works.
If I access a standard http:// -> ws:// proxy (e.g target1 below) - this works.
however
After accessing the ws:// (e.g target1 below) proxy redirect - all subsequent redirects (e.g target2,target3 below)then end up at the ws:// target1 instead for the remainder of the browser session.
I'm sure this is probably something to do with the socket remaining open or something along those lines, however I really do not know enough about it to begin guessing.
conf example below:
Code: | <IfModule mod_ssl.c>
<VirtualHost _default_:333>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/apache2/keys/fullchain.pem
SSLCertificateKeyFile /etc/apache2/keys/privkey.pem
ProxyPass /target1 ws://192.168.0.2:9981/target1
ProxyPassReverse /target1 ws://192.168.0.2:9981/target1
ProxyPass /target2 http://192.168.0.2:8989/target2 retry=0
ProxyPassReverse /target2 http://192.168.0.2:8989/target2/
ProxyPass /target3 http://192.168.0.2:8080/target3 retry=0
ProxyPassReverse /target3 http://192.168.0.2:8080/target3
</VirtualHost>
</IfModule> |
Any pointers would go a long way. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Mon 28 Aug '17 23:21 Post subject: |
|
|
Yepp it is because of the headers
HTTP Response
Quote: |
Upgrade: WebSocket
Connection: Upgrade
|
The browser keeps that.
So you may use location(s) instead of the vhost only and use unset header or set a different header. I'm not sure. I can't use sockets on windows with apache. |
|
Back to top |
|
|
|
|
|
|