Nginx configuration and supporting tools and tests for the redirector, an Ngnix server used to redirect old websites being moved to GOV.UK.
Each site is configured using a yaml file in the data/sites
directory:
site
— friendly name for the sitehost
— primary hostname for siteredirection_date
— planned go live datetna_timestamp
— timestamp of the last good National Archives capturetitle
— site title for 410 pagefurl
— friendly URL displayed on error pageshomepage
— URL for new site, used to redirect '/'aliases
— list of alias domains
A CSV file in data/mappings
for each site containing:
Old Url
— the Url to be redirected in canonical formNew Url
— the destination Url for a 301Status
— 301 for a redirect, 410 for a page which is being deprecatedSuggested Link
— an optional suggested link for the 410 pageArchive Link
— an alternative link to The National Archives for the 410 page
During development, mappings are usually generated from spreadsheets, or using scripts. Once live they are maintained in this repository.
New Url
values may only contain a hostname cited in data/whitelist.txt
.
An nginx server block for each site in redirector/configs
.
The build is through GNU Make, to build the site:
$ ./jenkins.sh
Nginx configuration is generated in dist
.
Directgov and Businesslink assets are stored in GitHub and deployed via s3, see assets-directgov and assets-businesslink.
A list of the most important urls to be tested on each website in data/tests/subsets/
.
export DEPLOY_TO=dev
./tools/smoke_tests.sh
export DEPLOY_TO=preview
./tools/smoke_tests.sh
export DEPLOY_TO=production
./tools/smoke_tests.sh
The redirector is deployed behind Akamai. The domain should be added as a property to the Akamai redirector configuration before changing the DNS of websites being redirected.