Skip to content

Instantly share code, notes, and snippets.

@matsuu
Created July 26, 2015 00:53
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 matsuu/927415fa65006082e6b8 to your computer and use it in GitHub Desktop.
Save matsuu/927415fa65006082e6b8 to your computer and use it in GitHub Desktop.
map $time_iso8601 $upstream {
default "app-b.example.org";
"~T(0|1[01])" "app-a.example.org";
}
server {
server_name app.example.org;
location / {
proxy_pass http://127.0.0.1;
proxy_set_header Host $upstream;
}
}
upstream app-a {
server app-a.example.net;
}
server {
server_name app-a.example.org;
access_log /var/log/nginx/app-a.access.log;
location / {
proxy_pass http://app-a;
}
}
upstream app-b {
server app-b.example.net;
}
server {
server_name app-b.example.org
access_log /var/log/nginx/app-b.access.log;
location / {
proxy_pass http://app-b;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment