Skip to content

Instantly share code, notes, and snippets.

@caquino
Last active April 19, 2018 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caquino/5a57bddc1dba8cb0ab8411dd680b61af to your computer and use it in GitHub Desktop.
Save caquino/5a57bddc1dba8cb0ab8411dd680b61af to your computer and use it in GitHub Desktop.
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 _;
set $mmethod "$http_x_replication_source$request_method";
if ( $mmethod ~ ^(POST|PUT|DELETE|PATCH)$ ) {
return 307 http://master.nginx-kv.service.consul$request_uri;
}
location /replicated {
api write=on;
}
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