I would like to serve data on one and the same host from different directories depending on a query parameter using Nginx.
For example https://foo.bar/index.html
should be served from /var/www/foo
and https://foo.bar/index.html?baz=quux
from /var/www/bar
.
I've tried to change the server root
conditionally, but it turns out it's not supported.
root /var/www/foo;
if ($args ~ baz=quux) {
# this is not gonna work but that is what is needed
# root /var/www/bar;
}