Re: [FBR] proxies: adding rewritecond to reverseproxy for ws if remotepath exists

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

 



On 3/22/19 1:04 PM, Tim Flink wrote:
> 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.
> ---
>  roles/httpd/reverseproxy/templates/reversepassproxy.conf | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/roles/httpd/reverseproxy/templates/reversepassproxy.conf
> b/roles/httpd/reverseproxy/templates/reversepassproxy.conf index
> 38950e4..1e4afe0 100644 ---
> a/roles/httpd/reverseproxy/templates/reversepassproxy.conf +++
> b/roles/httpd/reverseproxy/templates/reversepassproxy.conf @@ -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}}">
> 

+1

kevin


Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
infrastructure mailing list -- infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to infrastructure-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/infrastructure@xxxxxxxxxxxxxxxxxxxxxxx

[Index of Archives]     [Fedora Development]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux