diff --git a/src/connection.c b/src/connection.c index d186c2f01..3fedad9a5 100644 --- a/src/connection.c +++ b/src/connection.c @@ -2798,6 +2798,9 @@ int conn_reverse(struct connection *conn) conn->target = &l->obj_type; conn->flags |= CO_FL_ACT_REVERSING; task_wakeup(l->rx.rhttp.task, TASK_WOKEN_RES); + + /* Initialize session origin after reversal. Mandatory for several fetches. */ + sess->origin = &conn->obj_type; } /* Invert source and destination addresses if already set. */ diff --git a/src/proto_rhttp.c b/src/proto_rhttp.c index 9bf02157c..a6fc95574 100644 --- a/src/proto_rhttp.c +++ b/src/proto_rhttp.c @@ -62,6 +62,9 @@ static struct connection *new_reverse_conn(struct listener *l, struct server *sr HA_ATOMIC_INC(&th_ctx->nb_rhttp_conns); + /* session origin is only set after reversal. This ensures fetches + * will be functional only after reversal, in particular src/dst. + */ sess = session_new(l->bind_conf->frontend, l, NULL); if (!sess) goto err;