HTTP Routing

From Pumping Station One
Revision as of 21:33, 22 February 2016 by Kuroishi (talk | contribs) (Created page with "We have a reverse-proxy running for space.pumpingstationone.org. Contact the CTO if you would like a CNAME record added for yoursubdomain.pumpingstationone.org. https should...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

We have a reverse-proxy running for space.pumpingstationone.org. Contact the CTO if you would like a CNAME record added for yoursubdomain.pumpingstationone.org. https should be working for all listeners on :443, provided by wildcard SSL cert for *.pumpingstationone.org. Currently the reverse proxy is handled by nginx running on www1.ad.pumpingstationone.org. To create a vhost on the server, authenticate with www1 via your AD credentials and use sudo access to create /etc/nginx/sites-available/example.pumpingstationone.org.

upstream example {
        server example.ad.pumpingstationone.org:80;
}

server {
  listen 80;
  server_name example.pumpingstationone.org;
  return 301 https://example.pumpingstationone.org$request_uri;
}

server {
       listen 443 ssl spdy;
       server_name example.pumpingstationone.org;
       gzip on;

       proxy_connect_timeout       300;
       proxy_send_timeout          300;
       proxy_read_timeout          300;
       send_timeout                300;

       location / {
                       proxy_pass http://example;
                       proxy_set_header        Host                    $host;
                       proxy_set_header        X-Real-IP               $remote_addr;
                       proxy_set_header        X-Forwarded-For         $proxy_add_x_forwarded_for;
                       proxy_set_header        X-Forwarded-Proto       $scheme;
       }
}

Then symlink the configuration to /etc/nginx/sites-enabled as follows:

cd /etc/nginx/sites-enabled/
sudo ln -s ../sites-available/example.pumpingstationone.org

And reload nginx:

sudo systemctl reload nginx