Skip to content

About

Nginx proxy, based on query string

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

Proxy based on query string

This repo serves as an example of how to route traffic, based on a query parameter.

Run

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.

Implementation

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.

Watch demo

See the demo here.

About

Nginx proxy, based on query string

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages