Proxies traffic from the Federalist S3 bucket
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
public
test
.gitignore
CONTRIBUTING.md
LICENSE.md
README.md
manifest.yml
mime.types
nginx.conf
package-lock.json
package.json
staging_manifest.yml

README.md

federalist-proxy

CircleCI

Proxies traffic from the Federalist S3 bucket to a CDN broker. Ensures HTTPS and adds the proper headers.

Usage

To deploy the app:

$ cf push -f manifest.yml

Proxying a Site

When a site is added to Federalist, it will be available through this proxy at https://federalist-proxy.app.cloud.gov/site/<owner>/<repo>. When the site is ready to go live, a CloudFront distribution with the proxy URL as its origin can be provisioned.

cf create-service cdn-route cdn-route YOUR.URL.gov-route -c '
  {
    "domain": "YOUR.URL.gov",
    "origin": "federalist-proxy.app.cloud.gov",
    "path": "/site/org/repo-name"
  }
'

Headers

This proxy adds the following headers to the response from the S3 bucket:

  • Strict-Transport-Security: max-age=31536000
  • X-Frame-Options: SAMEORIGIN

Running locally using CF Local

The proxy can be run locally using CF Local. To start the site using CF Local, run the following after install CF Local plugin:

cf local pull federalist-proxy-staging
cf local run federalist-proxy-staging -f federalist-proxy-staging -w -d ./federalist-proxy-staging.droplet

In the terminal, take note of the port on which the proxy is running.

Running federalist-proxy-staging on port 12345...

The proxy should be available at https://localhost:12345/.