Clint Pachl
2021-04-16 00:58:30 UTC
Does anyone know if it's possible to rotate/alternate between two
files for the same given request path, using just httpd?
For example, I want to split test two pages: /test/A & /test/B. I would
like to serve half of the traffic to each for the request path /test/.
Ideally, I would like to do an internal rewrite of the request. And be
able to log which file was actually served to the client.
Here's what I have so far, but I would like to avoid the redirect and
URL change on the client.
# httpd.conf: A/B test
location "/test/*[0-4]" {
request rewrite "/test/A"
}
location "/test/*[5-9]" {
request rewrite "/test/B"
}
location "/test/" {
block return 302 "$DOCUMENT_URI$REMOTE_PORT"
}
I'm using OpenBSD 6.8. I see there is a "not found" directive in 6.9.
Maybe something like that could provide possibilities?
files for the same given request path, using just httpd?
For example, I want to split test two pages: /test/A & /test/B. I would
like to serve half of the traffic to each for the request path /test/.
Ideally, I would like to do an internal rewrite of the request. And be
able to log which file was actually served to the client.
Here's what I have so far, but I would like to avoid the redirect and
URL change on the client.
# httpd.conf: A/B test
location "/test/*[0-4]" {
request rewrite "/test/A"
}
location "/test/*[5-9]" {
request rewrite "/test/B"
}
location "/test/" {
block return 302 "$DOCUMENT_URI$REMOTE_PORT"
}
I'm using OpenBSD 6.8. I see there is a "not found" directive in 6.9.
Maybe something like that could provide possibilities?