[MAJOR] added the 'use_backend' keyword for full content-switching

The new "use_backend" keyword permits full content switching by the
use of ACLs. Its usage is simple :

   use_backend <backend_name> {if|unless} <acl_cond>
This commit is contained in:
Willy Tarreau
2007-06-17 19:56:27 +02:00
parent c11416f22f
commit 55ea7579d7
3 changed files with 104 additions and 0 deletions

View File

@@ -85,6 +85,7 @@ struct proxy {
} defbe;
struct list acl; /* ACL declared on this proxy */
struct list block_cond; /* early blocking conditions (chained) */
struct list switching_rules; /* content switching rules (chained) */
struct server *srv; /* known servers */
int srv_act, srv_bck; /* # of running servers */
int tot_wact, tot_wbck; /* total weights of active and backup servers */
@@ -150,6 +151,15 @@ struct proxy {
struct chunk errmsg[HTTP_ERR_SIZE]; /* default or customized error messages for known errors */
};
struct switching_rule {
struct list list; /* list linked to from the proxy */
struct acl_cond *cond; /* acl condition to meet */
union {
struct proxy *backend; /* target backend */
char *name; /* target backend name during config parsing */
} be;
};
extern struct proxy *proxy;
#endif /* _TYPES_PROXY_H */