Skip to main content

Application: bouncer

Handles traffic for sites that have transitioned to GOV.UK

AWS, on the bouncer machine class
Transition apps
Rake tasks
Integration, Staging or ⚠️ Production ⚠️

Relevant manual pages


This is a Rack-based redirector. It serves 301s and 410s from mappings created by Transition.

Technical documentation

You can use the GOV.UK Docker environment to run the application and its tests with all the necessary dependencies. Follow the usage instructions to get started.

Use GOV.UK Docker to run any commands that follow.

Running the tests

bundle exec rake

Testing redirects

In order to test the redirect feature of this app, you can use a special domain. We will create a mapping from this fake domain to GOV.UK.

  1. Setup the Transition repo.

  2. Run the following command in the Transition repo.

bundle exec rake import:all:orgs_sites_hosts

One of the created organisations will be “cabinet-office”, which we will use in the next step.

  1. Create a temporary site file in the Transition repo.
site: bouncer-redirect
whitehall_slug: cabinet-office
tna_timestamp: 20141104112824
global: =301
  1. Run the following command in the Transition repo.
bundle exec rake 'import:org_sites_hosts[<path-to-file>]'

This will create the site in the shared Transition / Bouncer DB.

  1. Start the Bouncer app and go to

You should see that it redirects to GOV.UK, as specified in the site file.


MIT License