{"action":"created","comment":{"url":"https://api.github.com/repos/StackStorm/st2/pulls/comments/194090386","pull_request_review_id":127203024,"id":194090386,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NDA5MDM4Ng==","diff_hunk":"@@ -76,14 +76,14 @@ server {\n \n   # For backward compatibility reasons, rewrite requests from \"/api/stream\"\n   # to \"/stream/v1/stream\" and \"/api/v1/stream\" to \"/stream/v1/stream\"\n-  location ~* (/stream/|/api(/v\\d)?/stream/?) {\n+  rewrite ^/api/stream/?$ /stream/v1/stream break;\n+  rewrite ^/api/(v\\d)/stream/?$ /stream/$1/stream break;\n+  location /stream/ {\n     error_page 502 = @streamError;\n \n     rewrite ^/stream/(.*)  /$1 break;\n-    rewrite ^/api/stream/?$ /v1/stream break;\n-    rewrite ^/api(/v\\d)?/stream/?$ $1/stream break;\n \n-    proxy_pass  http://127.0.0.1:9102;\n+    proxy_pass  http://127.0.0.1:9102/;","path":"conf/nginx/st2.conf","position":15,"original_position":15,"commit_id":"6cc1d517ddc3b4b08823fd124672b26168c67d7b","original_commit_id":"6cc1d517ddc3b4b08823fd124672b26168c67d7b","user":{"login":"armab","id":1533818,"node_id":"MDQ6VXNlcjE1MzM4MTg=","avatar_url":"https://avatars2.githubusercontent.com/u/1533818?v=4","gravatar_id":"","url":"https://api.github.com/users/armab","html_url":"https://github.com/armab","followers_url":"https://api.github.com/users/armab/followers","following_url":"https://api.github.com/users/armab/following{/other_user}","gists_url":"https://api.github.com/users/armab/gists{/gist_id}","starred_url":"https://api.github.com/users/armab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/armab/subscriptions","organizations_url":"https://api.github.com/users/armab/orgs","repos_url":"https://api.github.com/users/armab/repos","events_url":"https://api.github.com/users/armab/events{/privacy}","received_events_url":"https://api.github.com/users/armab/received_events","type":"User","site_admin":false},"body":"This is actual line with the issue","created_at":"2018-06-08T15:13:39Z","updated_at":"2018-06-08T15:13:39Z","html_url":"https://github.com/StackStorm/st2/pull/4172#discussion_r194090386","pull_request_url":"https://api.github.com/repos/StackStorm/st2/pulls/4172","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/StackStorm/st2/pulls/comments/194090386"},"html":{"href":"https://github.com/StackStorm/st2/pull/4172#discussion_r194090386"},"pull_request":{"href":"https://api.github.com/repos/StackStorm/st2/pulls/4172"}}},"pull_request":{"url":"https://api.github.com/repos/StackStorm/st2/pulls/4172","id":193643579,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzNjQzNTc5","html_url":"https://github.com/StackStorm/st2/pull/4172","diff_url":"https://github.com/StackStorm/st2/pull/4172.diff","patch_url":"https://github.com/StackStorm/st2/pull/4172.patch","issue_url":"https://api.github.com/repos/StackStorm/st2/issues/4172","number":4172,"state":"open","locked":false,"title":"Fix nginx 'proxy_pass' directive can't use URI in regex location","user":{"login":"armab","id":1533818,"node_id":"MDQ6VXNlcjE1MzM4MTg=","avatar_url":"https://avatars2.githubusercontent.com/u/1533818?v=4","gravatar_id":"","url":"https://api.github.com/users/armab","html_url":"https://github.com/armab","followers_url":"https://api.github.com/users/armab/followers","following_url":"https://api.github.com/users/armab/following{/other_user}","gists_url":"https://api.github.com/users/armab/gists{/gist_id}","starred_url":"https://api.github.com/users/armab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/armab/subscriptions","organizations_url":"https://api.github.com/users/armab/orgs","repos_url":"https://api.github.com/users/armab/repos","events_url":"https://api.github.com/users/armab/events{/privacy}","received_events_url":"https://api.github.com/users/armab/received_events","type":"User","site_admin":false},"body":"Using regex for location doesn't allow to specify full URI for  `proxy_pass` (with trailing slash).\r\n\r\nDuring Docker/K8s work we need to substitute the API_URL, AUTH_URL and STREAM_URL in nginx `st2.conf` replacing existing proxy endpoints.\r\n\r\nAnd so we can't use dynamic URIs like `http://random-ip-or-domain:maybe-port/` because:\r\n```\r\nnginx: [emerg] \"proxy_pass\" cannot have URI part in location given by regular expression, or inside named location, or inside \"if\" statement, or inside \"limit_except\" block in /etc/nginx/conf.d/st2.conf:87\r\n```\r\n\r\nThis small nginx config adjustment removing regex from `st2stream` location makes var substitution easier.\r\n\r\nMore on this:\r\n* https://stackoverflow.com/questions/21662940/nginx-proxy-pass-cannot-have-uri-part-in-location\r\n* https://serverfault.com/questions/649151/nginx-location-regex-doesnt-work-with-proxy-pass","created_at":"2018-06-08T15:09:50Z","updated_at":"2018-06-08T15:13:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f25fb1dc070fefa9fe932779630c30e373d50911","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":195346253,"node_id":"MDU6TGFiZWwxOTUzNDYyNTM=","url":"https://api.github.com/repos/StackStorm/st2/labels/RFR","name":"RFR","color":"eb6420","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/StackStorm/st2/pulls/4172/commits","review_comments_url":"https://api.github.com/repos/StackStorm/st2/pulls/4172/comments","review_comment_url":"https://api.github.com/repos/StackStorm/st2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/StackStorm/st2/issues/4172/comments","statuses_url":"https://api.github.com/repos/StackStorm/st2/statuses/6cc1d517ddc3b4b08823fd124672b26168c67d7b","head":{"label":"StackStorm:fix/nginx-proxy-pass-uri","ref":"fix/nginx-proxy-pass-uri","sha":"6cc1d517ddc3b4b08823fd124672b26168c67d7b","user":{"login":"StackStorm","id":4969009,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5NjkwMDk=","avatar_url":"https://avatars3.githubusercontent.com/u/4969009?v=4","gravatar_id":"","url":"https://api.github.com/users/StackStorm","html_url":"https://github.com/StackStorm","followers_url":"https://api.github.com/users/StackStorm/followers","following_url":"https://api.github.com/users/StackStorm/following{/other_user}","gists_url":"https://api.github.com/users/StackStorm/gists{/gist_id}","starred_url":"https://api.github.com/users/StackStorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StackStorm/subscriptions","organizations_url":"https://api.github.com/users/StackStorm/orgs","repos_url":"https://api.github.com/users/StackStorm/repos","events_url":"https://api.github.com/users/StackStorm/events{/privacy}","received_events_url":"https://api.github.com/users/StackStorm/received_events","type":"Organization","site_admin":false},"repo":{"id":19051806,"node_id":"MDEwOlJlcG9zaXRvcnkxOTA1MTgwNg==","name":"st2","full_name":"StackStorm/st2","owner":{"login":"StackStorm","id":4969009,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5NjkwMDk=","avatar_url":"https://avatars3.githubusercontent.com/u/4969009?v=4","gravatar_id":"","url":"https://api.github.com/users/StackStorm","html_url":"https://github.com/StackStorm","followers_url":"https://api.github.com/users/StackStorm/followers","following_url":"https://api.github.com/users/StackStorm/following{/other_user}","gists_url":"https://api.github.com/users/StackStorm/gists{/gist_id}","starred_url":"https://api.github.com/users/StackStorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StackStorm/subscriptions","organizations_url":"https://api.github.com/users/StackStorm/orgs","repos_url":"https://api.github.com/users/StackStorm/repos","events_url":"https://api.github.com/users/StackStorm/events{/privacy}","received_events_url":"https://api.github.com/users/StackStorm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/StackStorm/st2","description":"StackStorm (aka \"IFTTT for Ops\") is event-driven automation for auto-remediation, security responses, troubleshooting, deployments, and more. Includes rules engine, workflow, 2000+ integrations (see https://exchange.stackstorm.org), ChatOps, etc. Installer at https://docs.stackstorm.com/install/index.html. Questions? https://forum.stackstorm.com/.","fork":false,"url":"https://api.github.com/repos/StackStorm/st2","forks_url":"https://api.github.com/repos/StackStorm/st2/forks","keys_url":"https://api.github.com/repos/StackStorm/st2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/StackStorm/st2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/StackStorm/st2/teams","hooks_url":"https://api.github.com/repos/StackStorm/st2/hooks","issue_events_url":"https://api.github.com/repos/StackStorm/st2/issues/events{/number}","events_url":"https://api.github.com/repos/StackStorm/st2/events","assignees_url":"https://api.github.com/repos/StackStorm/st2/assignees{/user}","branches_url":"https://api.github.com/repos/StackStorm/st2/branches{/branch}","tags_url":"https://api.github.com/repos/StackStorm/st2/tags","blobs_url":"https://api.github.com/repos/StackStorm/st2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/StackStorm/st2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/StackStorm/st2/git/refs{/sha}","trees_url":"https://api.github.com/repos/StackStorm/st2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/StackStorm/st2/statuses/{sha}","languages_url":"https://api.github.com/repos/StackStorm/st2/languages","stargazers_url":"https://api.github.com/repos/StackStorm/st2/stargazers","contributors_url":"https://api.github.com/repos/StackStorm/st2/contributors","subscribers_url":"https://api.github.com/repos/StackStorm/st2/subscribers","subscription_url":"https://api.github.com/repos/StackStorm/st2/subscription","commits_url":"https://api.github.com/repos/StackStorm/st2/commits{/sha}","git_commits_url":"https://api.github.com/repos/StackStorm/st2/git/commits{/sha}","comments_url":"https://api.github.com/repos/StackStorm/st2/comments{/number}","issue_comment_url":"https://api.github.com/repos/StackStorm/st2/issues/comments{/number}","contents_url":"https://api.github.com/repos/StackStorm/st2/contents/{+path}","compare_url":"https://api.github.com/repos/StackStorm/st2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/StackStorm/st2/merges","archive_url":"https://api.github.com/repos/StackStorm/st2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/StackStorm/st2/downloads","issues_url":"https://api.github.com/repos/StackStorm/st2/issues{/number}","pulls_url":"https://api.github.com/repos/StackStorm/st2/pulls{/number}","milestones_url":"https://api.github.com/repos/StackStorm/st2/milestones{/number}","notifications_url":"https://api.github.com/repos/StackStorm/st2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/StackStorm/st2/labels{/name}","releases_url":"https://api.github.com/repos/StackStorm/st2/releases{/id}","deployments_url":"https://api.github.com/repos/StackStorm/st2/deployments","created_at":"2014-04-23T00:51:34Z","updated_at":"2018-06-08T08:56:37Z","pushed_at":"2018-06-08T15:10:03Z","git_url":"git://github.com/StackStorm/st2.git","ssh_url":"git@github.com:StackStorm/st2.git","clone_url":"https://github.com/StackStorm/st2.git","svn_url":"https://github.com/StackStorm/st2","homepage":"http://www.stackstorm.com/","size":24091,"stargazers_count":2654,"watchers_count":2654,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":348,"mirror_url":null,"archived":false,"open_issues_count":343,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":348,"open_issues":343,"watchers":2654,"default_branch":"master"}},"base":{"label":"StackStorm:master","ref":"master","sha":"f2acf0f65ecde50426c890feaf01550010e8a6c8","user":{"login":"StackStorm","id":4969009,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5NjkwMDk=","avatar_url":"https://avatars3.githubusercontent.com/u/4969009?v=4","gravatar_id":"","url":"https://api.github.com/users/StackStorm","html_url":"https://github.com/StackStorm","followers_url":"https://api.github.com/users/StackStorm/followers","following_url":"https://api.github.com/users/StackStorm/following{/other_user}","gists_url":"https://api.github.com/users/StackStorm/gists{/gist_id}","starred_url":"https://api.github.com/users/StackStorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StackStorm/subscriptions","organizations_url":"https://api.github.com/users/StackStorm/orgs","repos_url":"https://api.github.com/users/StackStorm/repos","events_url":"https://api.github.com/users/StackStorm/events{/privacy}","received_events_url":"https://api.github.com/users/StackStorm/received_events","type":"Organization","site_admin":false},"repo":{"id":19051806,"node_id":"MDEwOlJlcG9zaXRvcnkxOTA1MTgwNg==","name":"st2","full_name":"StackStorm/st2","owner":{"login":"StackStorm","id":4969009,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5NjkwMDk=","avatar_url":"https://avatars3.githubusercontent.com/u/4969009?v=4","gravatar_id":"","url":"https://api.github.com/users/StackStorm","html_url":"https://github.com/StackStorm","followers_url":"https://api.github.com/users/StackStorm/followers","following_url":"https://api.github.com/users/StackStorm/following{/other_user}","gists_url":"https://api.github.com/users/StackStorm/gists{/gist_id}","starred_url":"https://api.github.com/users/StackStorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StackStorm/subscriptions","organizations_url":"https://api.github.com/users/StackStorm/orgs","repos_url":"https://api.github.com/users/StackStorm/repos","events_url":"https://api.github.com/users/StackStorm/events{/privacy}","received_events_url":"https://api.github.com/users/StackStorm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/StackStorm/st2","description":"StackStorm (aka \"IFTTT for Ops\") is event-driven automation for auto-remediation, security responses, troubleshooting, deployments, and more. Includes rules engine, workflow, 2000+ integrations (see https://exchange.stackstorm.org), ChatOps, etc. Installer at https://docs.stackstorm.com/install/index.html. Questions? https://forum.stackstorm.com/.","fork":false,"url":"https://api.github.com/repos/StackStorm/st2","forks_url":"https://api.github.com/repos/StackStorm/st2/forks","keys_url":"https://api.github.com/repos/StackStorm/st2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/StackStorm/st2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/StackStorm/st2/teams","hooks_url":"https://api.github.com/repos/StackStorm/st2/hooks","issue_events_url":"https://api.github.com/repos/StackStorm/st2/issues/events{/number}","events_url":"https://api.github.com/repos/StackStorm/st2/events","assignees_url":"https://api.github.com/repos/StackStorm/st2/assignees{/user}","branches_url":"https://api.github.com/repos/StackStorm/st2/branches{/branch}","tags_url":"https://api.github.com/repos/StackStorm/st2/tags","blobs_url":"https://api.github.com/repos/StackStorm/st2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/StackStorm/st2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/StackStorm/st2/git/refs{/sha}","trees_url":"https://api.github.com/repos/StackStorm/st2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/StackStorm/st2/statuses/{sha}","languages_url":"https://api.github.com/repos/StackStorm/st2/languages","stargazers_url":"https://api.github.com/repos/StackStorm/st2/stargazers","contributors_url":"https://api.github.com/repos/StackStorm/st2/contributors","subscribers_url":"https://api.github.com/repos/StackStorm/st2/subscribers","subscription_url":"https://api.github.com/repos/StackStorm/st2/subscription","commits_url":"https://api.github.com/repos/StackStorm/st2/commits{/sha}","git_commits_url":"https://api.github.com/repos/StackStorm/st2/git/commits{/sha}","comments_url":"https://api.github.com/repos/StackStorm/st2/comments{/number}","issue_comment_url":"https://api.github.com/repos/StackStorm/st2/issues/comments{/number}","contents_url":"https://api.github.com/repos/StackStorm/st2/contents/{+path}","compare_url":"https://api.github.com/repos/StackStorm/st2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/StackStorm/st2/merges","archive_url":"https://api.github.com/repos/StackStorm/st2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/StackStorm/st2/downloads","issues_url":"https://api.github.com/repos/StackStorm/st2/issues{/number}","pulls_url":"https://api.github.com/repos/StackStorm/st2/pulls{/number}","milestones_url":"https://api.github.com/repos/StackStorm/st2/milestones{/number}","notifications_url":"https://api.github.com/repos/StackStorm/st2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/StackStorm/st2/labels{/name}","releases_url":"https://api.github.com/repos/StackStorm/st2/releases{/id}","deployments_url":"https://api.github.com/repos/StackStorm/st2/deployments","created_at":"2014-04-23T00:51:34Z","updated_at":"2018-06-08T08:56:37Z","pushed_at":"2018-06-08T15:10:03Z","git_url":"git://github.com/StackStorm/st2.git","ssh_url":"git@github.com:StackStorm/st2.git","clone_url":"https://github.com/StackStorm/st2.git","svn_url":"https://github.com/StackStorm/st2","homepage":"http://www.stackstorm.com/","size":24091,"stargazers_count":2654,"watchers_count":2654,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":348,"mirror_url":null,"archived":false,"open_issues_count":343,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":348,"open_issues":343,"watchers":2654,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/StackStorm/st2/pulls/4172"},"html":{"href":"https://github.com/StackStorm/st2/pull/4172"},"issue":{"href":"https://api.github.com/repos/StackStorm/st2/issues/4172"},"comments":{"href":"https://api.github.com/repos/StackStorm/st2/issues/4172/comments"},"review_comments":{"href":"https://api.github.com/repos/StackStorm/st2/pulls/4172/comments"},"review_comment":{"href":"https://api.github.com/repos/StackStorm/st2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/StackStorm/st2/pulls/4172/commits"},"statuses":{"href":"https://api.github.com/repos/StackStorm/st2/statuses/6cc1d517ddc3b4b08823fd124672b26168c67d7b"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"armab"}}