{"action":"created","issue":{"url":"https://api.github.com/repos/bitly/oauth2_proxy/issues/237","repository_url":"https://api.github.com/repos/bitly/oauth2_proxy","labels_url":"https://api.github.com/repos/bitly/oauth2_proxy/issues/237/labels{/name}","comments_url":"https://api.github.com/repos/bitly/oauth2_proxy/issues/237/comments","events_url":"https://api.github.com/repos/bitly/oauth2_proxy/issues/237/events","html_url":"https://github.com/bitly/oauth2_proxy/issues/237","id":148959097,"number":237,"title":"Multiple Sub Domains","user":{"login":"amlwwalker","id":2920180,"avatar_url":"https://avatars.githubusercontent.com/u/2920180?v=3","gravatar_id":"","url":"https://api.github.com/users/amlwwalker","html_url":"https://github.com/amlwwalker","followers_url":"https://api.github.com/users/amlwwalker/followers","following_url":"https://api.github.com/users/amlwwalker/following{/other_user}","gists_url":"https://api.github.com/users/amlwwalker/gists{/gist_id}","starred_url":"https://api.github.com/users/amlwwalker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amlwwalker/subscriptions","organizations_url":"https://api.github.com/users/amlwwalker/orgs","repos_url":"https://api.github.com/users/amlwwalker/repos","events_url":"https://api.github.com/users/amlwwalker/events{/privacy}","received_events_url":"https://api.github.com/users/amlwwalker/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2016-04-17T14:44:11Z","updated_at":"2016-05-31T12:46:05Z","closed_at":null,"body":"Can this be used to handle multiple sub domains at once?\r\nFor instance, if Nginx is used to route x.company.com and y.company.com can this be used as authentication for both, and on successful auth it passes the connection to the right application? I can see you can have multiple upstreams, but it looks like you can only have one `redirect-url`"},"comment":{"url":"https://api.github.com/repos/bitly/oauth2_proxy/issues/comments/222677493","html_url":"https://github.com/bitly/oauth2_proxy/issues/237#issuecomment-222677493","issue_url":"https://api.github.com/repos/bitly/oauth2_proxy/issues/237","id":222677493,"user":{"login":"ChristopherJacob","id":6109456,"avatar_url":"https://avatars.githubusercontent.com/u/6109456?v=3","gravatar_id":"","url":"https://api.github.com/users/ChristopherJacob","html_url":"https://github.com/ChristopherJacob","followers_url":"https://api.github.com/users/ChristopherJacob/followers","following_url":"https://api.github.com/users/ChristopherJacob/following{/other_user}","gists_url":"https://api.github.com/users/ChristopherJacob/gists{/gist_id}","starred_url":"https://api.github.com/users/ChristopherJacob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChristopherJacob/subscriptions","organizations_url":"https://api.github.com/users/ChristopherJacob/orgs","repos_url":"https://api.github.com/users/ChristopherJacob/repos","events_url":"https://api.github.com/users/ChristopherJacob/events{/privacy}","received_events_url":"https://api.github.com/users/ChristopherJacob/received_events","type":"User","site_admin":false},"created_at":"2016-05-31T12:46:05Z","updated_at":"2016-05-31T12:46:05Z","body":"Hey guys, I have tried configuring oauth2_proxy to do this, but I get a 400 Bad Request The plain HTTP request was sent to HTTPS port\r\n\r\noauth2_proxy is configured using...\r\n\r\n```\r\nhttp_address = \"127.0.0.1:4180\"\r\nupstreams = \"http://127.0.0.1:5180\"\r\nrequest_logging = true\r\npass_host_header = true\r\nemail_domains = [\r\n     \"xxxxxxx.com\"\r\n ]\r\nclient_id = \"xxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com\"\r\nclient_secret = \"xxxxxxxxxxxxxxxxx\"\r\ncookie_name = \"_oauth2_proxy\"\r\ncookie_secret = \"XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX\"\r\n```\r\n\r\n\r\nand the NGINX is configured....\r\n\r\n```\r\nserver {\r\n    listen 443 default ssl;\r\n    server_name www.mydomain.com;\r\n    ssl_certificate           /etc/nginx/cert.crt;\r\n    ssl_certificate_key       /etc/nginx/cert.key;\r\n    add_header Strict-Transport-Security max-age=2592000;\r\n    access_log  /var/log/nginx/scratchpad.access.log main;\r\n    error_log  /var/log/nginx/scratchpad.error.log;\r\n    location / {\r\n        proxy_set_header Host $host;\r\n        proxy_set_header        X-Real-IP $remote_addr;\r\n        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;\r\n        proxy_set_header        X-Forwarded-Proto $scheme;\r\n        proxy_pass http://127.0.0.1:4180/;\r\n    }\r\n\r\n}\r\n\r\nserver {\r\n    listen 127.0.0.1:5180;\r\n    server_name www.mydomain.com;\r\n    add_header Strict-Transport-Security max-age=2592000;\r\n    access_log  /var/log/nginx/oauth.scratchpad.access.log main;\r\n    error_log  /var/log/nginx/ioauth.scratchpad.error.log;\r\n    location / {\r\n        proxy_set_header        X-Real-IP $remote_addr;\r\n        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;\r\n        proxy_set_header        X-Forwarded-Proto $scheme;\r\n        proxy_set_header Host $host;\r\n        proxy_pass https://10.0.1.142/;\r\n    }\r\n}\r\n```\r\nI feel like I am almost there, but I just can't get it figured out.\r\n\r\nThanks!\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"ChristopherJacob"}}