-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/2.x/9.3.3' into 2.x-master
- Loading branch information
Showing
6 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
map $uri $redirect_uri { | ||
include /etc/nginx/govcms-redirects-map.conf; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
## Path redirects | ||
## | ||
## This file provide the ability to redirect paths, this will redirect all paths | ||
## to the incomming host. | ||
## | ||
## @see http://nginx.org/en/docs/http/ngx_http_map_module.html | ||
## | ||
## 1. This will match $uri (uri will always be at least '/') | ||
## 2. Destination of the redirect (must always be prefixed with '/') | ||
## 3. Destination supports external hostnames for full redirects | ||
|
||
## Redirect old-paths from the host to new paths. | ||
## ~^/old-path/(.*) /new-path/$1; | ||
|
||
# Redirect patterns to a new host. | ||
## ~^/old/(.*) http://other-domain.gov.au/$1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
set $check "no_redirect"; | ||
|
||
if ($redirect_uri) { | ||
set $check "has_redirect"; | ||
} | ||
|
||
if ($redirect_uri ~ ^/) { | ||
set $check "$check+has_leading_slash"; | ||
} | ||
|
||
if ($check = "has_redirect+has_leading_slash") { | ||
# TLS is not terminated by the namespace nginx to prevent | ||
# recusrive redirects we hard code the scheme here. | ||
return 301 https://$host$redirect_uri; | ||
} | ||
|
||
if ($check = "has_redirect") { | ||
return 301 $redirect_uri; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters