This repo serves as an example of how to route traffic, based on a query parameter.
Clone this repo, run docker-compose up -d and visit either http://localhost
for v1 and http://localhost/?v=2 for v2 of the site.
Once you run the project, three containers will be created. Two are simple Python servers, each running a different site.
The third container is an Nginx container that runs a custom Nginx config. The
gist of the solution is to use Nginx's map directive to set the backend server
to site1 or site2, depending on whether a query parameter of v equals to
2.
See the demo here.