haproxy根据url选择连接模式

haproxy根据url选择连接模式

本文介绍了haproxy根据url选择连接模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为一个请求的URL设置特殊的连接模式(httpclose),所以我在haproxy中的前端配置看起来像

I want to set a special connection mode (httpclose) for one requested url, so my frontend configuration in haproxy looks like

....
acl is_conclose url_beg /close.php
option httpclose if is_conclose
...

问题:haproxy始终使用"option httpclose",而忽略条件"if is_conclose".

The problem: haproxy always uses "option httpclose" and is ignoring the condition "if is_conclose".

如何设置haproxy以符合条件?

How can I setup haproxy to respect the condition?

推荐答案

option httpclose 可以在前端或后端上指定,并且对于给定请求,无论是在前端还是在后端遇到,其行为都相同.

option httpclose can be specified on either the frontend or the backend, and behaves the same whether it is encountered on the frontend or the backend for a given request.

您是否尝试仅为规则结束的那个后端设置option httpclose?

Have you tried setting option httpclose only for that backend where the rule ends up?

如果可行,我将复制后端(如果需要)并通过新后端路由该规则,然后仅对新后端指定选项httpclose.

If that works, I'd duplicate the backend (if needed) and route that rule thru the new backend, but then specify option httpclose for the new one only.

这篇关于haproxy根据url选择连接模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 18:54