proxies: adding rewritecond to reverseproxy for ws if remotepath exists
I was hitting an issue where there were multiple reverseproxy instances configured for a single host and some of the rewrite rules were changing the request when they shouldn't be. This patch adds a rewritecond to the websocket rewrite rule to make sure that the REQUEST_URI starts with $remotepath before it's rewritten.
This commit is contained in:
parent
ccccf7ef30
commit
16b791a146
1 changed files with 3 additions and 0 deletions
|
@ -47,6 +47,9 @@ SSLProxyEngine On
|
|||
RewriteEngine on
|
||||
RewriteCond %{HTTP:Upgrade} ^WebSocket$ [NC]
|
||||
RewriteCond %{HTTP:Connection} Upgrade [NC]
|
||||
{% if remotepath is defined %}
|
||||
RewriteCond %{REQUEST_URI} ^{{ remotepath }}/(.)*
|
||||
{% endif %}
|
||||
RewriteRule .* "balancer://{{ balancer_name }}-websocket%{REQUEST_URI}" [P]
|
||||
|
||||
<Proxy "balancer://{{balancer_name}}">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue