Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

proxy for the review-o-matic side-by-side browser

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 public
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Procfile
Octocat-spinner-32 README.md
Octocat-spinner-32 build.sh
Octocat-spinner-32 explorer.js
Octocat-spinner-32 jenkins.sh
Octocat-spinner-32 package.json
Octocat-spinner-32 proxy.js
Octocat-spinner-32 server.js
README.md

review-o-matic-explore

Simple node.js proxy to serve a side-by-side browser and a site being reviewed under on the same domain, so the side-by-side browser is 'live' and not blocked by Same-Origin-Policy.

$ node server.js

Run the tests

$ npm install
$ npm test

Setup Nginx to supply headers

The proxy can be used to serve, subject to headers, For example to proxy www.direct.gov.uk on explore-dg.dev.gov.uk:

upstream explore-dg.dev.gov.uk-proxy {
    server localhost:3023;
}

server {
  server_name explore-dg.dev.co.uk ;

  listen 80;

  proxy_set_header Host $http_host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-Server $host;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_redirect off;

  access_log /var/log/nginx/explore-dg.dev.co.uk-access.log timed_combined;
  error_log /var/log/nginx/explore-dg.dev.co.uk-error.log;

  location / {
    proxy_pass http://explore-dg.dev.co.uk-proxy;
  }

  # headers to proxy DirectGov
  proxy_set_header X-Explore-Upstream www.direct.gov.uk;
  proxy_set_header X-Explore-Redirector redirector.dev.gov.uk;
  proxy_set_header X-Explore-Name DirectGov;
}
Something went wrong with that request. Please try again.