{"action":"created","issue":{"url":"https://api.github.com/repos/GrahamDumpleton/mod_wsgi/issues/86","labels_url":"https://api.github.com/repos/GrahamDumpleton/mod_wsgi/issues/86/labels{/name}","comments_url":"https://api.github.com/repos/GrahamDumpleton/mod_wsgi/issues/86/comments","events_url":"https://api.github.com/repos/GrahamDumpleton/mod_wsgi/issues/86/events","html_url":"https://github.com/GrahamDumpleton/mod_wsgi/issues/86","id":99404912,"number":86,"title":"Redirect to ssl behind a Load Balancer","user":{"login":"jakobholmelund","id":244930,"avatar_url":"https://avatars.githubusercontent.com/u/244930?v=3","gravatar_id":"","url":"https://api.github.com/users/jakobholmelund","html_url":"https://github.com/jakobholmelund","followers_url":"https://api.github.com/users/jakobholmelund/followers","following_url":"https://api.github.com/users/jakobholmelund/following{/other_user}","gists_url":"https://api.github.com/users/jakobholmelund/gists{/gist_id}","starred_url":"https://api.github.com/users/jakobholmelund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakobholmelund/subscriptions","organizations_url":"https://api.github.com/users/jakobholmelund/orgs","repos_url":"https://api.github.com/users/jakobholmelund/repos","events_url":"https://api.github.com/users/jakobholmelund/events{/privacy}","received_events_url":"https://api.github.com/users/jakobholmelund/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":25,"created_at":"2015-08-06T10:27:17Z","updated_at":"2015-08-27T00:36:46Z","closed_at":null,"body":"I was wondering how to redirect all users to https. From what i could find, the prefered solution is to use something like this\r\n\r\nNameVirtualHost *:80\r\n<VirtualHost *:80>\r\n   ServerName mysite.example.com\r\n   DocumentRoot /usr/local/apache2/htdocs \r\n   Redirect permanent / https://mysite.example.com/\r\n</VirtualHost>\r\n\r\n<VirtualHost _default_:443>\r\n   ServerName mysite.example.com\r\n  DocumentRoot /usr/local/apache2/htdocs\r\n  SSLEngine On\r\n # etc...\r\n</VirtualHost>\r\n\r\nAnd another solution is to use something like\r\n\r\nRewriteEngine On\r\nRewriteCond %{HTTPS} off\r\nRewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI}\r\n\r\nSince i'm behind a preconfigured Load Balancer, i'm not even sure if i'm supposed to use Apache for this. Right now, i'm using --include-file= and i can't seem to get any of the solutions to work. Am i doing something totally wrong ?\r\n"},"comment":{"url":"https://api.github.com/repos/GrahamDumpleton/mod_wsgi/issues/comments/135218965","html_url":"https://github.com/GrahamDumpleton/mod_wsgi/issues/86#issuecomment-135218965","issue_url":"https://api.github.com/repos/GrahamDumpleton/mod_wsgi/issues/86","id":135218965,"user":{"login":"GrahamDumpleton","id":507637,"avatar_url":"https://avatars.githubusercontent.com/u/507637?v=3","gravatar_id":"","url":"https://api.github.com/users/GrahamDumpleton","html_url":"https://github.com/GrahamDumpleton","followers_url":"https://api.github.com/users/GrahamDumpleton/followers","following_url":"https://api.github.com/users/GrahamDumpleton/following{/other_user}","gists_url":"https://api.github.com/users/GrahamDumpleton/gists{/gist_id}","starred_url":"https://api.github.com/users/GrahamDumpleton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GrahamDumpleton/subscriptions","organizations_url":"https://api.github.com/users/GrahamDumpleton/orgs","repos_url":"https://api.github.com/users/GrahamDumpleton/repos","events_url":"https://api.github.com/users/GrahamDumpleton/events{/privacy}","received_events_url":"https://api.github.com/users/GrahamDumpleton/received_events","type":"User","site_admin":false},"created_at":"2015-08-27T00:36:46Z","updated_at":"2015-08-27T00:36:46Z","body":"Can you use:\r\n\r\n* https://code.google.com/p/modwsgi/wiki/DebuggingTechniques#Displaying_Request_Environment\r\n\r\nto at least capture the WSGI request environment so I can see what is sent and show exactly what your middleware is doing.\r\n\r\nEven better use:\r\n\r\n* https://code.google.com/p/modwsgi/wiki/DebuggingTechniques#Tracking_Request_and_Response\r\n\r\nto also capture all the response headers."}}