GitHub PullRequestEvent at 2014-11-26 20:44:17
Repository: docker-nginx
Actor: fancyremarker
Payload: {"action":"opened","number":28,"pull_request":{"url":"https://api.github.com/repos/aptible/docker-nginx/pulls/28","id":25112692,"html_url":"https://github.com/aptible/docker-nginx/pull/28","diff_url":"https://github.com/aptible/docker-nginx/pull/28.diff","patch_url":"https://github.com/aptible/docker-nginx/pull/28.patch","issue_url":"https://api.github.com/repos/aptible/docker-nginx/issues/28","number":28,"state":"open","locked":false,"title":"Fork default (HTTP) config for Proxy Protocol proxy","user":{"login":"fancyremarker","id":156030,"avatar_url":"https://avatars.githubusercontent.com/u/156030?v=3","gravatar_id":"","url":"https://api.github.com/users/fancyremarker","html_url":"https://github.com/fancyremarker","followers_url":"https://api.github.com/users/fancyremarker/followers","following_url":"https://api.github.com/users/fancyremarker/following{/other_user}","gists_url":"https://api.github.com/users/fancyremarker/gists{/gist_id}","starred_url":"https://api.github.com/users/fancyremarker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fancyremarker/subscriptions","organizations_url":"https://api.github.com/users/fancyremarker/orgs","repos_url":"https://api.github.com/users/fancyremarker/repos","events_url":"https://api.github.com/users/fancyremarker/events{/privacy}","received_events_url":"https://api.github.com/users/fancyremarker/received_events","type":"User","site_admin":false},"body":"cc: @aaw \r\n\r\nThis is the necessary configuration change to support #9, logging the original requester's IP address and passing it through a TCP-only Elastic Load Balancer to the NGiNX reverse proxy (without decrypting the HTTPS request).\r\n\r\nThe code change has been tested and works, but requires the additional configuration changes to the Elastic Load Balancer to enable Proxy Protocol:\r\n\r\n```\r\nelb create-load-balancer-policy --load-balancer-name $ELB_NAME --policy-name EnableProxyProtocol  --policy-type-name ProxyProtocolPolicyType --policy-attributes AttributeName=ProxyProtocol,AttributeValue=True\r\nelb set-load-balancer-policies-for-backend-server --load-balancer-name $ELB_NAME --instance-port $INSTANCE_HTTP_PORT --policy-names EnableProxyProtocol\r\nelb set-load-balancer-policies-for-backend-server --load-balancer-name $ELB_NAME --instance-port $INSTANCE_HTTPS_PORT --policy-names EnableProxyProtocol\r\n```\r\n\r\nThe BATS tests were harder to adapt. To simulate Proxy Protocol requests, I included HAProxy, the originators of the Proxy Protocol spec, who make it easy to configure Proxy Protocol. For some strange reason, it takes about 5 seconds for NGiNX to start responding to Proxy Protocol requests. In the meantime, requests just get dropped. This is \\#NoMeGusta but \\#YODOO (You Only DevOps Once).\r\n\r\nOne question I have is: should this be a separate branch (and Docker tag), as I've PRed it? Or should we branch on an environment variable, say `ENV['PROXY_PROTOCOL'] == 'true'`? I initially leaned toward a separate branch, because a Proxy Protocol proxy and an HTTP proxy are mutually incompatible; that is, a Proxy Protocol proxy cannot interpret plain HTTP(S) requests, and an HTTP proxy cannot interpret Proxy Protocol requests. I wish there was a way in NGiNX to check whether a request has Proxy Protocol headers, and only parse it as a Proxy Protocol request if so, but I can't see how to do that.","created_at":"2014-11-26T20:44:17Z","updated_at":"2014-11-26T20:44:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aptible/docker-nginx/pulls/28/commits","review_comments_url":"https://api.github.com/repos/aptible/docker-nginx/pulls/28/comments","review_comment_url":"https://api.github.com/repos/aptible/docker-nginx/pulls/comments/{number}","comments_url":"https://api.github.com/repos/aptible/docker-nginx/issues/28/comments","statuses_url":"https://api.github.com/repos/aptible/docker-nginx/statuses/8b61c2fcb8c637bbfd0c53910d60bcab89f88ab6","head":{"label":"fancyremarker:proxy-protocol","ref":"proxy-protocol","sha":"8b61c2fcb8c637bbfd0c53910d60bcab89f88ab6","user":{"login":"fancyremarker","id":156030,"avatar_url":"https://avatars.githubusercontent.com/u/156030?v=3","gravatar_id":"","url":"https://api.github.com/users/fancyremarker","html_url":"https://github.com/fancyremarker","followers_url":"https://api.github.com/users/fancyremarker/followers","following_url":"https://api.github.com/users/fancyremarker/following{/other_user}","gists_url":"https://api.github.com/users/fancyremarker/gists{/gist_id}","starred_url":"https://api.github.com/users/fancyremarker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fancyremarker/subscriptions","organizations_url":"https://api.github.com/users/fancyremarker/orgs","repos_url":"https://api.github.com/users/fancyremarker/repos","events_url":"https://api.github.com/users/fancyremarker/events{/privacy}","received_events_url":"https://api.github.com/users/fancyremarker/received_events","type":"User","site_admin":false},"repo":{"id":20841414,"name":"docker-nginx","full_name":"fancyremarker/docker-nginx","owner":{"login":"fancyremarker","id":156030,"avatar_url":"https://avatars.githubusercontent.com/u/156030?v=3","gravatar_id":"","url":"https://api.github.com/users/fancyremarker","html_url":"https://github.com/fancyremarker","followers_url":"https://api.github.com/users/fancyremarker/followers","following_url":"https://api.github.com/users/fancyremarker/following{/other_user}","gists_url":"https://api.github.com/users/fancyremarker/gists{/gist_id}","starred_url":"https://api.github.com/users/fancyremarker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fancyremarker/subscriptions","organizations_url":"https://api.github.com/users/fancyremarker/orgs","repos_url":"https://api.github.com/users/fancyremarker/repos","events_url":"https://api.github.com/users/fancyremarker/events{/privacy}","received_events_url":"https://api.github.com/users/fancyremarker/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fancyremarker/docker-nginx","description":"NGiNX HTTP server","fork":true,"url":"https://api.github.com/repos/fancyremarker/docker-nginx","forks_url":"https://api.github.com/repos/fancyremarker/docker-nginx/forks","keys_url":"https://api.github.com/repos/fancyremarker/docker-nginx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fancyremarker/docker-nginx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fancyremarker/docker-nginx/teams","hooks_url":"https://api.github.com/repos/fancyremarker/docker-nginx/hooks","issue_events_url":"https://api.github.com/repos/fancyremarker/docker-nginx/issues/events{/number}","events_url":"https://api.github.com/repos/fancyremarker/docker-nginx/events","assignees_url":"https://api.github.com/repos/fancyremarker/docker-nginx/assignees{/user}","branches_url":"https://api.github.com/repos/fancyremarker/docker-nginx/branches{/branch}","tags_url":"https://api.github.com/repos/fancyremarker/docker-nginx/tags","blobs_url":"https://api.github.com/repos/fancyremarker/docker-nginx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fancyremarker/docker-nginx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fancyremarker/docker-nginx/git/refs{/sha}","trees_url":"https://api.github.com/repos/fancyremarker/docker-nginx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fancyremarker/docker-nginx/statuses/{sha}","languages_url":"https://api.github.com/repos/fancyremarker/docker-nginx/languages","stargazers_url":"https://api.github.com/repos/fancyremarker/docker-nginx/stargazers","contributors_url":"https://api.github.com/repos/fancyremarker/docker-nginx/contributors","subscribers_url":"https://api.github.com/repos/fancyremarker/docker-nginx/subscribers","subscription_url":"https://api.github.com/repos/fancyremarker/docker-nginx/subscription","commits_url":"https://api.github.com/repos/fancyremarker/docker-nginx/commits{/sha}","git_commits_url":"https://api.github.com/repos/fancyremarker/docker-nginx/git/commits{/sha}","comments_url":"https://api.github.com/repos/fancyremarker/docker-nginx/comments{/number}","issue_comment_url":"https://api.github.com/repos/fancyremarker/docker-nginx/issues/comments/{number}","contents_url":"https://api.github.com/repos/fancyremarker/docker-nginx/contents/{+path}","compare_url":"https://api.github.com/repos/fancyremarker/docker-nginx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fancyremarker/docker-nginx/merges","archive_url":"https://api.github.com/repos/fancyremarker/docker-nginx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fancyremarker/docker-nginx/downloads","issues_url":"https://api.github.com/repos/fancyremarker/docker-nginx/issues{/number}","pulls_url":"https://api.github.com/repos/fancyremarker/docker-nginx/pulls{/number}","milestones_url":"https://api.github.com/repos/fancyremarker/docker-nginx/milestones{/number}","notifications_url":"https://api.github.com/repos/fancyremarker/docker-nginx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fancyremarker/docker-nginx/labels{/name}","releases_url":"https://api.github.com/repos/fancyremarker/docker-nginx/releases{/id}","created_at":"2014-06-14T20:35:17Z","updated_at":"2014-06-14T20:55:05Z","pushed_at":"2014-11-26T20:24:06Z","git_url":"git://github.com/fancyremarker/docker-nginx.git","ssh_url":"git@github.com:fancyremarker/docker-nginx.git","clone_url":"https://github.com/fancyremarker/docker-nginx.git","svn_url":"https://github.com/fancyremarker/docker-nginx","homepage":"","size":234,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"aptible:proxy-protocol","ref":"proxy-protocol","sha":"a1ed253966c5ef22dec8cc437448b1c7bf50ccf2","user":{"login":"aptible","id":4594193,"avatar_url":"https://avatars.githubusercontent.com/u/4594193?v=3","gravatar_id":"","url":"https://api.github.com/users/aptible","html_url":"https://github.com/aptible","followers_url":"https://api.github.com/users/aptible/followers","following_url":"https://api.github.com/users/aptible/following{/other_user}","gists_url":"https://api.github.com/users/aptible/gists{/gist_id}","starred_url":"https://api.github.com/users/aptible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aptible/subscriptions","organizations_url":"https://api.github.com/users/aptible/orgs","repos_url":"https://api.github.com/users/aptible/repos","events_url":"https://api.github.com/users/aptible/events{/privacy}","received_events_url":"https://api.github.com/users/aptible/received_events","type":"Organization","site_admin":false},"repo":{"id":17886962,"name":"docker-nginx","full_name":"aptible/docker-nginx","owner":{"login":"aptible","id":4594193,"avatar_url":"https://avatars.githubusercontent.com/u/4594193?v=3","gravatar_id":"","url":"https://api.github.com/users/aptible","html_url":"https://github.com/aptible","followers_url":"https://api.github.com/users/aptible/followers","following_url":"https://api.github.com/users/aptible/following{/other_user}","gists_url":"https://api.github.com/users/aptible/gists{/gist_id}","starred_url":"https://api.github.com/users/aptible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aptible/subscriptions","organizations_url":"https://api.github.com/users/aptible/orgs","repos_url":"https://api.github.com/users/aptible/repos","events_url":"https://api.github.com/users/aptible/events{/privacy}","received_events_url":"https://api.github.com/users/aptible/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aptible/docker-nginx","description":"NGiNX HTTP server","fork":false,"url":"https://api.github.com/repos/aptible/docker-nginx","forks_url":"https://api.github.com/repos/aptible/docker-nginx/forks","keys_url":"https://api.github.com/repos/aptible/docker-nginx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aptible/docker-nginx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aptible/docker-nginx/teams","hooks_url":"https://api.github.com/repos/aptible/docker-nginx/hooks","issue_events_url":"https://api.github.com/repos/aptible/docker-nginx/issues/events{/number}","events_url":"https://api.github.com/repos/aptible/docker-nginx/events","assignees_url":"https://api.github.com/repos/aptible/docker-nginx/assignees{/user}","branches_url":"https://api.github.com/repos/aptible/docker-nginx/branches{/branch}","tags_url":"https://api.github.com/repos/aptible/docker-nginx/tags","blobs_url":"https://api.github.com/repos/aptible/docker-nginx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aptible/docker-nginx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aptible/docker-nginx/git/refs{/sha}","trees_url":"https://api.github.com/repos/aptible/docker-nginx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aptible/docker-nginx/statuses/{sha}","languages_url":"https://api.github.com/repos/aptible/docker-nginx/languages","stargazers_url":"https://api.github.com/repos/aptible/docker-nginx/stargazers","contributors_url":"https://api.github.com/repos/aptible/docker-nginx/contributors","subscribers_url":"https://api.github.com/repos/aptible/docker-nginx/subscribers","subscription_url":"https://api.github.com/repos/aptible/docker-nginx/subscription","commits_url":"https://api.github.com/repos/aptible/docker-nginx/commits{/sha}","git_commits_url":"https://api.github.com/repos/aptible/docker-nginx/git/commits{/sha}","comments_url":"https://api.github.com/repos/aptible/docker-nginx/comments{/number}","issue_comment_url":"https://api.github.com/repos/aptible/docker-nginx/issues/comments/{number}","contents_url":"https://api.github.com/repos/aptible/docker-nginx/contents/{+path}","compare_url":"https://api.github.com/repos/aptible/docker-nginx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aptible/docker-nginx/merges","archive_url":"https://api.github.com/repos/aptible/docker-nginx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aptible/docker-nginx/downloads","issues_url":"https://api.github.com/repos/aptible/docker-nginx/issues{/number}","pulls_url":"https://api.github.com/repos/aptible/docker-nginx/pulls{/number}","milestones_url":"https://api.github.com/repos/aptible/docker-nginx/milestones{/number}","notifications_url":"https://api.github.com/repos/aptible/docker-nginx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aptible/docker-nginx/labels{/name}","releases_url":"https://api.github.com/repos/aptible/docker-nginx/releases{/id}","created_at":"2014-03-19T00:22:55Z","updated_at":"2014-11-26T14:42:24Z","pushed_at":"2014-11-26T20:43:52Z","git_url":"git://github.com/aptible/docker-nginx.git","ssh_url":"git@github.com:aptible/docker-nginx.git","clone_url":"https://github.com/aptible/docker-nginx.git","svn_url":"https://github.com/aptible/docker-nginx","homepage":"","size":405,"stargazers_count":1,"watchers_count":1,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":7,"forks":3,"open_issues":7,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aptible/docker-nginx/pulls/28"},"html":{"href":"https://github.com/aptible/docker-nginx/pull/28"},"issue":{"href":"https://api.github.com/repos/aptible/docker-nginx/issues/28"},"comments":{"href":"https://api.github.com/repos/aptible/docker-nginx/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/aptible/docker-nginx/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/aptible/docker-nginx/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/aptible/docker-nginx/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/aptible/docker-nginx/statuses/8b61c2fcb8c637bbfd0c53910d60bcab89f88ab6"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":79,"deletions":15,"changed_files":5}}