{"action":"created","issue":{"url":"https://api.github.com/repos/tonycoco/heroku-buildpack-ember-cli/issues/85","labels_url":"https://api.github.com/repos/tonycoco/heroku-buildpack-ember-cli/issues/85/labels{/name}","comments_url":"https://api.github.com/repos/tonycoco/heroku-buildpack-ember-cli/issues/85/comments","events_url":"https://api.github.com/repos/tonycoco/heroku-buildpack-ember-cli/issues/85/events","html_url":"https://github.com/tonycoco/heroku-buildpack-ember-cli/pull/85","id":86939389,"number":85,"title":"Add force HTTPS support for CloudFlare","user":{"login":"harianus","id":1079135,"avatar_url":"https://avatars.githubusercontent.com/u/1079135?v=3","gravatar_id":"","url":"https://api.github.com/users/harianus","html_url":"https://github.com/harianus","followers_url":"https://api.github.com/users/harianus/followers","following_url":"https://api.github.com/users/harianus/following{/other_user}","gists_url":"https://api.github.com/users/harianus/gists{/gist_id}","starred_url":"https://api.github.com/users/harianus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harianus/subscriptions","organizations_url":"https://api.github.com/users/harianus/orgs","repos_url":"https://api.github.com/users/harianus/repos","events_url":"https://api.github.com/users/harianus/events{/privacy}","received_events_url":"https://api.github.com/users/harianus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-10T11:43:32Z","updated_at":"2015-06-18T09:25:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/tonycoco/heroku-buildpack-ember-cli/pulls/85","html_url":"https://github.com/tonycoco/heroku-buildpack-ember-cli/pull/85","diff_url":"https://github.com/tonycoco/heroku-buildpack-ember-cli/pull/85.diff","patch_url":"https://github.com/tonycoco/heroku-buildpack-ember-cli/pull/85.patch"},"body":"As discussed in https://github.com/tonycoco/heroku-buildpack-ember-cli/issues/83 I added support for the CloudFlare SSL header. Updated the docs with links to the official documentation.\r\n\r\nI saw nowhere in the nginx config file comments, so I left the comments out of the pull request, I'll add it here so we can always find it.\r\n\r\n```erb\r\n<% if ENV[\"FORCE_HTTPS\"] && ENV[\"FORCE_HTTPS\"] == \"true\" %>\r\n  <%# Set default value for CloudFlare %>\r\n  set $cloudflare NO;\r\n  <%# This matches http and https ($http_cf_visitor: {\"scheme\": \"https\"})%>\r\n  if ($http_cf_visitor ~* 'http') {\r\n    set $cloudflare YES;\r\n  }\r\n  <%# Redirect when is matches \"http\" (with quotes) %>\r\n  if ($http_cf_visitor ~* '\"http\"') {\r\n    return 301 https://$host$request_uri;\r\n  }\r\n\r\n  <%# Only redirect when CloudFlare is false %>\r\n  set $cloudflare_heroku \"${cloudflare}\";\r\n  <%# Test for Heroku header, this matches http and https %>\r\n  if ($http_x_forwarded_proto ~* 'http') {\r\n    set $cloudflare_heroku \"${cloudflare_heroku}YES\";\r\n  }\r\n  <%# Test for \"https\" (without quotes) in Heroku header %>\r\n  if ($http_x_forwarded_proto !~* 'https') {\r\n    set $cloudflare_heroku \"${cloudflare_heroku}HTTP\";\r\n  }\r\n  <%# Redirect when CloudFlare is false and Heroku http is true %>\r\n  if ($cloudflare_heroku = NOYESHTTP) {\r\n    return 301 https://$host$request_uri;\r\n  }\r\n<% end %>\r\n```"},"comment":{"url":"https://api.github.com/repos/tonycoco/heroku-buildpack-ember-cli/issues/comments/113088161","html_url":"https://github.com/tonycoco/heroku-buildpack-ember-cli/pull/85#issuecomment-113088161","issue_url":"https://api.github.com/repos/tonycoco/heroku-buildpack-ember-cli/issues/85","id":113088161,"user":{"login":"harianus","id":1079135,"avatar_url":"https://avatars.githubusercontent.com/u/1079135?v=3","gravatar_id":"","url":"https://api.github.com/users/harianus","html_url":"https://github.com/harianus","followers_url":"https://api.github.com/users/harianus/followers","following_url":"https://api.github.com/users/harianus/following{/other_user}","gists_url":"https://api.github.com/users/harianus/gists{/gist_id}","starred_url":"https://api.github.com/users/harianus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harianus/subscriptions","organizations_url":"https://api.github.com/users/harianus/orgs","repos_url":"https://api.github.com/users/harianus/repos","events_url":"https://api.github.com/users/harianus/events{/privacy}","received_events_url":"https://api.github.com/users/harianus/received_events","type":"User","site_admin":false},"created_at":"2015-06-18T09:25:40Z","updated_at":"2015-06-18T09:25:40Z","body":"Added the dollar as requested."}}