Skip to content

Instantly share code, notes, and snippets.

@caquino
Last active April 19, 2018 12:56
Show Gist options
  • Save caquino/10d4c33e66da6520a34abc03fb268fd6 to your computer and use it in GitHub Desktop.
Save caquino/10d4c33e66da6520a34abc03fb268fd6 to your computer and use it in GitHub Desktop.
resolver consul:8600 valid=2s ipv6=off;
resolver_timeout 2s;
keyval_zone zone=default:32k state=default.json;
keyval $arg_text $text1 zone=default;
server {
status_zone default;
root /usr/share/nginx/html;
listen 80 default_server;
server_name _;
location /replicated {
mirror /mirror;
api write=on;
}
location /mirror {
internal;
proxy_set_header X-Replication-Source master;
limit_except GET HEAD {
proxy_pass http://slave.nginx-kv.service.consul$request_uri;
}
}
location / {
try_files $uri $uri/ index.html;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment