Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (21 sloc) 1.44 KB
## Nginx redirect map
## This file is expected to have two entries per line:
## 1. source, which will be matched against '$host$uri' from nginx (so the hostname and uri, while uri is always at least /)
## 2. destination of the redirect
## The file is read from top to bottom, so more specific sources need to be above more general matches
## A couple of examples:
## Simple www to non www redirect, with preserving the URL string and arguments
# ~^www.example.com http://example.com$request_uri;
## Simple non-www to www redirect, with preserving the URL string and arguments
#~^example.com http://www.example.com$request_uri;
## Redirect every request to example.com to example.net with preserving the URL string and arguments, eg: example.com/bla -> example.net/bla, example.com/bla?test -> example.net/bla?test
##
# ~^example.com http://example.net$request_uri;
## Redirect request only to example.com/test (no regex matching) to example.net without preserving the URL string, eg: example.com/test -> example.net
## Requestes to example.com/test/bla or example.com/bla are not matched
##
# example.com/test http://example.net;
## Redirect request only to example.com/test to example.net with preserving the rest of the URL string and arguments, eg: example.com/test/bla -> example.net/bla, example.com/test/bla?test -> example.net/bla?test
## Requestes to example.com/bla are not matched
##
# ~^example.com/test/(.*) http://example.net/$1$is_args$args;
You can’t perform that action at this time.