Skip to content

Instantly share code, notes, and snippets.

@LoonyPandora
Last active December 11, 2015 20:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LoonyPandora/4657616 to your computer and use it in GitHub Desktop.
Save LoonyPandora/4657616 to your computer and use it in GitHub Desktop.
#--------------------------------------------------------------------------
# PORT ALLOCATION:
# - usr1 => 5001 to 5020
# - usr2 => 5021 to 5040
# - usr3 => 5041 to 5060
#--------------------------------------------------------------------------
server {
listen 5001;
server_name $hostname.internal.ac.uk;
root /www/usr/www/usr1/Clinical/public;
include proxies.conf;
}
#--------------------------------------------------------------------------
server {
listen 5021;
server_name $hostname.internal.ac.uk;
root /www/usr/www/usr2/Clinical/public;
include proxies.conf;
}
#--------------------------------------------------------------------------
server {
listen 5041;
server_name $hostname.internal.ac.uk;
root /www/usr/www/usr3/Clinical/public;
include proxies.conf;
#--------------------------------------------------------------------------
# rewrite to home page for the cosmic site;
rewrite ^/$ /projects/clinic/ permanent;
rewrite ^/clinic$ /projects/clinic/ permanent;
rewrite ^/mp$ /projects/mp/index.html last;
location / {
try_files $uri @proxy;
access_log off;
expires max;
}
location @proxy {
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://$hostname.internal.ac.uk:5042;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment