{"action":"created","comment":{"url":"https://api.github.com/repos/hashicorp/consul-template/pulls/comments/79069180","id":79069180,"diff_hunk":"@@ -1283,6 +1283,75 @@ This will still add the dependency to the list of watches, but Go will not evalu\n \n Examples\n --------\n+### NGINX\n+NGINX is one of the most popular open source web server, reverse proxy and load balancer for high‑traffic sites. You can read more about NGINX configuration file syntax and all the different available NGINX modules in its [documentation](http://nginx.org/en/docs/), but here is an example template for rendering an NGINX configuration file with Consul Template:\n+\n+```liquid\n+{{range services}} {{$name := .Name}} {{$service := service .Name}}\n+upstream {{$name}} {\n+  zone upstream-{{$name}} 64k;\n+  {{range $service}}server {{.Address}}:{{.Port}} max_fails=3 fail_timeout=60 weight=1;\n+  {{else}}server 127.0.0.1:65535; # force a 502{{end}}\n+} {{end}}\n+\n+server {\n+  listen 80 default_server;\n+\n+  location / {\n+    root /usr/share/nginx/html/;\n+    index index.html;\n+  }\n+\n+  location /stub_status {\n+    stub_status;\n+  }\n+\n+{{range services}} {{$name := .Name}}\n+  location /{{$name}} {\n+    proxy_pass http://{{$name}};\n+  }\n+{{end}}\n+}\n+```\n+\n+Save this file to disk as `nginx.ctmpl` and  run the `consul-template` daemon:\n+\n+```shell\n+$ consul-template \\\n+  -consul demo.consul.io \\\n+  -template nginx.ctmpl:/etc/nginx/conf.d/default.conf\n+  -dry\n+```\n+\n+Depending on the state of the demo Consul instance and assuming that the only service registered with Consul here is the one which needs to be load balanced by NGINX, you could see the following output:","path":"README.md","position":null,"original_position":44,"commit_id":"9e29c28b4589f571dd06ff01da39d31649dc7436","original_commit_id":"62ecade513fcd7b32aedd61f13f54b89e811e8cb","user":{"login":"kunalvjti","id":1437560,"avatar_url":"https://avatars.githubusercontent.com/u/1437560?v=3","gravatar_id":"","url":"https://api.github.com/users/kunalvjti","html_url":"https://github.com/kunalvjti","followers_url":"https://api.github.com/users/kunalvjti/followers","following_url":"https://api.github.com/users/kunalvjti/following{/other_user}","gists_url":"https://api.github.com/users/kunalvjti/gists{/gist_id}","starred_url":"https://api.github.com/users/kunalvjti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kunalvjti/subscriptions","organizations_url":"https://api.github.com/users/kunalvjti/orgs","repos_url":"https://api.github.com/users/kunalvjti/repos","events_url":"https://api.github.com/users/kunalvjti/events{/privacy}","received_events_url":"https://api.github.com/users/kunalvjti/received_events","type":"User","site_admin":false},"body":"Done. Thanks","created_at":"2016-09-15T21:46:40Z","updated_at":"2016-09-15T21:46:40Z","html_url":"https://github.com/hashicorp/consul-template/pull/710#discussion_r79069180","pull_request_url":"https://api.github.com/repos/hashicorp/consul-template/pulls/710","_links":{"self":{"href":"https://api.github.com/repos/hashicorp/consul-template/pulls/comments/79069180"},"html":{"href":"https://github.com/hashicorp/consul-template/pull/710#discussion_r79069180"},"pull_request":{"href":"https://api.github.com/repos/hashicorp/consul-template/pulls/710"}}},"pull_request":{"url":"https://api.github.com/repos/hashicorp/consul-template/pulls/710","id":85448598,"html_url":"https://github.com/hashicorp/consul-template/pull/710","diff_url":"https://github.com/hashicorp/consul-template/pull/710.diff","patch_url":"https://github.com/hashicorp/consul-template/pull/710.patch","issue_url":"https://api.github.com/repos/hashicorp/consul-template/issues/710","number":710,"state":"open","locked":false,"title":"NGINX example in Consul Template Readme","user":{"login":"kunalvjti","id":1437560,"avatar_url":"https://avatars.githubusercontent.com/u/1437560?v=3","gravatar_id":"","url":"https://api.github.com/users/kunalvjti","html_url":"https://github.com/kunalvjti","followers_url":"https://api.github.com/users/kunalvjti/followers","following_url":"https://api.github.com/users/kunalvjti/following{/other_user}","gists_url":"https://api.github.com/users/kunalvjti/gists{/gist_id}","starred_url":"https://api.github.com/users/kunalvjti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kunalvjti/subscriptions","organizations_url":"https://api.github.com/users/kunalvjti/orgs","repos_url":"https://api.github.com/users/kunalvjti/repos","events_url":"https://api.github.com/users/kunalvjti/events{/privacy}","received_events_url":"https://api.github.com/users/kunalvjti/received_events","type":"User","site_admin":false},"body":"Adding NGINX as an example too in the README","created_at":"2016-09-15T17:45:55Z","updated_at":"2016-09-15T21:46:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"df06c173d8ce8a5f0029cc9b3e76cea3d08fe6cd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/hashicorp/consul-template/pulls/710/commits","review_comments_url":"https://api.github.com/repos/hashicorp/consul-template/pulls/710/comments","review_comment_url":"https://api.github.com/repos/hashicorp/consul-template/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hashicorp/consul-template/issues/710/comments","statuses_url":"https://api.github.com/repos/hashicorp/consul-template/statuses/9e29c28b4589f571dd06ff01da39d31649dc7436","head":{"label":"kunalvjti:master","ref":"master","sha":"9e29c28b4589f571dd06ff01da39d31649dc7436","user":{"login":"kunalvjti","id":1437560,"avatar_url":"https://avatars.githubusercontent.com/u/1437560?v=3","gravatar_id":"","url":"https://api.github.com/users/kunalvjti","html_url":"https://github.com/kunalvjti","followers_url":"https://api.github.com/users/kunalvjti/followers","following_url":"https://api.github.com/users/kunalvjti/following{/other_user}","gists_url":"https://api.github.com/users/kunalvjti/gists{/gist_id}","starred_url":"https://api.github.com/users/kunalvjti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kunalvjti/subscriptions","organizations_url":"https://api.github.com/users/kunalvjti/orgs","repos_url":"https://api.github.com/users/kunalvjti/repos","events_url":"https://api.github.com/users/kunalvjti/events{/privacy}","received_events_url":"https://api.github.com/users/kunalvjti/received_events","type":"User","site_admin":false},"repo":{"id":68244878,"name":"consul-template","full_name":"kunalvjti/consul-template","owner":{"login":"kunalvjti","id":1437560,"avatar_url":"https://avatars.githubusercontent.com/u/1437560?v=3","gravatar_id":"","url":"https://api.github.com/users/kunalvjti","html_url":"https://github.com/kunalvjti","followers_url":"https://api.github.com/users/kunalvjti/followers","following_url":"https://api.github.com/users/kunalvjti/following{/other_user}","gists_url":"https://api.github.com/users/kunalvjti/gists{/gist_id}","starred_url":"https://api.github.com/users/kunalvjti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kunalvjti/subscriptions","organizations_url":"https://api.github.com/users/kunalvjti/orgs","repos_url":"https://api.github.com/users/kunalvjti/repos","events_url":"https://api.github.com/users/kunalvjti/events{/privacy}","received_events_url":"https://api.github.com/users/kunalvjti/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kunalvjti/consul-template","description":"Generic template rendering and notifications with Consul","fork":true,"url":"https://api.github.com/repos/kunalvjti/consul-template","forks_url":"https://api.github.com/repos/kunalvjti/consul-template/forks","keys_url":"https://api.github.com/repos/kunalvjti/consul-template/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kunalvjti/consul-template/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kunalvjti/consul-template/teams","hooks_url":"https://api.github.com/repos/kunalvjti/consul-template/hooks","issue_events_url":"https://api.github.com/repos/kunalvjti/consul-template/issues/events{/number}","events_url":"https://api.github.com/repos/kunalvjti/consul-template/events","assignees_url":"https://api.github.com/repos/kunalvjti/consul-template/assignees{/user}","branches_url":"https://api.github.com/repos/kunalvjti/consul-template/branches{/branch}","tags_url":"https://api.github.com/repos/kunalvjti/consul-template/tags","blobs_url":"https://api.github.com/repos/kunalvjti/consul-template/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kunalvjti/consul-template/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kunalvjti/consul-template/git/refs{/sha}","trees_url":"https://api.github.com/repos/kunalvjti/consul-template/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kunalvjti/consul-template/statuses/{sha}","languages_url":"https://api.github.com/repos/kunalvjti/consul-template/languages","stargazers_url":"https://api.github.com/repos/kunalvjti/consul-template/stargazers","contributors_url":"https://api.github.com/repos/kunalvjti/consul-template/contributors","subscribers_url":"https://api.github.com/repos/kunalvjti/consul-template/subscribers","subscription_url":"https://api.github.com/repos/kunalvjti/consul-template/subscription","commits_url":"https://api.github.com/repos/kunalvjti/consul-template/commits{/sha}","git_commits_url":"https://api.github.com/repos/kunalvjti/consul-template/git/commits{/sha}","comments_url":"https://api.github.com/repos/kunalvjti/consul-template/comments{/number}","issue_comment_url":"https://api.github.com/repos/kunalvjti/consul-template/issues/comments{/number}","contents_url":"https://api.github.com/repos/kunalvjti/consul-template/contents/{+path}","compare_url":"https://api.github.com/repos/kunalvjti/consul-template/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kunalvjti/consul-template/merges","archive_url":"https://api.github.com/repos/kunalvjti/consul-template/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kunalvjti/consul-template/downloads","issues_url":"https://api.github.com/repos/kunalvjti/consul-template/issues{/number}","pulls_url":"https://api.github.com/repos/kunalvjti/consul-template/pulls{/number}","milestones_url":"https://api.github.com/repos/kunalvjti/consul-template/milestones{/number}","notifications_url":"https://api.github.com/repos/kunalvjti/consul-template/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kunalvjti/consul-template/labels{/name}","releases_url":"https://api.github.com/repos/kunalvjti/consul-template/releases{/id}","deployments_url":"https://api.github.com/repos/kunalvjti/consul-template/deployments","created_at":"2016-09-14T21:28:57Z","updated_at":"2016-09-14T21:28:58Z","pushed_at":"2016-09-15T21:40:52Z","git_url":"git://github.com/kunalvjti/consul-template.git","ssh_url":"git@github.com:kunalvjti/consul-template.git","clone_url":"https://github.com/kunalvjti/consul-template.git","svn_url":"https://github.com/kunalvjti/consul-template","homepage":"","size":3739,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"hashicorp:master","ref":"master","sha":"a519d8ab481d4662e56036782e0854a10d8029f6","user":{"login":"hashicorp","id":761456,"avatar_url":"https://avatars.githubusercontent.com/u/761456?v=3","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"repo":{"id":24898177,"name":"consul-template","full_name":"hashicorp/consul-template","owner":{"login":"hashicorp","id":761456,"avatar_url":"https://avatars.githubusercontent.com/u/761456?v=3","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hashicorp/consul-template","description":"Generic template rendering and notifications with Consul","fork":false,"url":"https://api.github.com/repos/hashicorp/consul-template","forks_url":"https://api.github.com/repos/hashicorp/consul-template/forks","keys_url":"https://api.github.com/repos/hashicorp/consul-template/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hashicorp/consul-template/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hashicorp/consul-template/teams","hooks_url":"https://api.github.com/repos/hashicorp/consul-template/hooks","issue_events_url":"https://api.github.com/repos/hashicorp/consul-template/issues/events{/number}","events_url":"https://api.github.com/repos/hashicorp/consul-template/events","assignees_url":"https://api.github.com/repos/hashicorp/consul-template/assignees{/user}","branches_url":"https://api.github.com/repos/hashicorp/consul-template/branches{/branch}","tags_url":"https://api.github.com/repos/hashicorp/consul-template/tags","blobs_url":"https://api.github.com/repos/hashicorp/consul-template/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hashicorp/consul-template/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hashicorp/consul-template/git/refs{/sha}","trees_url":"https://api.github.com/repos/hashicorp/consul-template/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hashicorp/consul-template/statuses/{sha}","languages_url":"https://api.github.com/repos/hashicorp/consul-template/languages","stargazers_url":"https://api.github.com/repos/hashicorp/consul-template/stargazers","contributors_url":"https://api.github.com/repos/hashicorp/consul-template/contributors","subscribers_url":"https://api.github.com/repos/hashicorp/consul-template/subscribers","subscription_url":"https://api.github.com/repos/hashicorp/consul-template/subscription","commits_url":"https://api.github.com/repos/hashicorp/consul-template/commits{/sha}","git_commits_url":"https://api.github.com/repos/hashicorp/consul-template/git/commits{/sha}","comments_url":"https://api.github.com/repos/hashicorp/consul-template/comments{/number}","issue_comment_url":"https://api.github.com/repos/hashicorp/consul-template/issues/comments{/number}","contents_url":"https://api.github.com/repos/hashicorp/consul-template/contents/{+path}","compare_url":"https://api.github.com/repos/hashicorp/consul-template/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hashicorp/consul-template/merges","archive_url":"https://api.github.com/repos/hashicorp/consul-template/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hashicorp/consul-template/downloads","issues_url":"https://api.github.com/repos/hashicorp/consul-template/issues{/number}","pulls_url":"https://api.github.com/repos/hashicorp/consul-template/pulls{/number}","milestones_url":"https://api.github.com/repos/hashicorp/consul-template/milestones{/number}","notifications_url":"https://api.github.com/repos/hashicorp/consul-template/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hashicorp/consul-template/labels{/name}","releases_url":"https://api.github.com/repos/hashicorp/consul-template/releases{/id}","deployments_url":"https://api.github.com/repos/hashicorp/consul-template/deployments","created_at":"2014-10-07T15:52:00Z","updated_at":"2016-09-15T16:52:15Z","pushed_at":"2016-09-15T21:40:52Z","git_url":"git://github.com/hashicorp/consul-template.git","ssh_url":"git@github.com:hashicorp/consul-template.git","clone_url":"https://github.com/hashicorp/consul-template.git","svn_url":"https://github.com/hashicorp/consul-template","homepage":"","size":4203,"stargazers_count":1709,"watchers_count":1709,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":216,"mirror_url":null,"open_issues_count":11,"forks":216,"open_issues":11,"watchers":1709,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hashicorp/consul-template/pulls/710"},"html":{"href":"https://github.com/hashicorp/consul-template/pull/710"},"issue":{"href":"https://api.github.com/repos/hashicorp/consul-template/issues/710"},"comments":{"href":"https://api.github.com/repos/hashicorp/consul-template/issues/710/comments"},"review_comments":{"href":"https://api.github.com/repos/hashicorp/consul-template/pulls/710/comments"},"review_comment":{"href":"https://api.github.com/repos/hashicorp/consul-template/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hashicorp/consul-template/pulls/710/commits"},"statuses":{"href":"https://api.github.com/repos/hashicorp/consul-template/statuses/9e29c28b4589f571dd06ff01da39d31649dc7436"}}}}
{"actor":{"display_login":"kunalvjti"}}