{"action":"created","issue":{"url":"https://api.github.com/repos/noirbizarre/flask-restplus/issues/54","labels_url":"https://api.github.com/repos/noirbizarre/flask-restplus/issues/54/labels{/name}","comments_url":"https://api.github.com/repos/noirbizarre/flask-restplus/issues/54/comments","events_url":"https://api.github.com/repos/noirbizarre/flask-restplus/issues/54/events","html_url":"https://github.com/noirbizarre/flask-restplus/issues/54","id":91032919,"number":54,"title":"No way to configure .../swagger.json to go over HTTPS?","user":{"login":"Iulian7","id":11798936,"avatar_url":"https://avatars.githubusercontent.com/u/11798936?v=3","gravatar_id":"","url":"https://api.github.com/users/Iulian7","html_url":"https://github.com/Iulian7","followers_url":"https://api.github.com/users/Iulian7/followers","following_url":"https://api.github.com/users/Iulian7/following{/other_user}","gists_url":"https://api.github.com/users/Iulian7/gists{/gist_id}","starred_url":"https://api.github.com/users/Iulian7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Iulian7/subscriptions","organizations_url":"https://api.github.com/users/Iulian7/orgs","repos_url":"https://api.github.com/users/Iulian7/repos","events_url":"https://api.github.com/users/Iulian7/events{/privacy}","received_events_url":"https://api.github.com/users/Iulian7/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-25T17:54:24Z","updated_at":"2015-09-03T16:26:37Z","closed_at":null,"body":"Hello,\r\n\r\nI have an application deployed using Flask-RESTPlus. Everything works nicely when it goes over http, but soon as I switch to https, it can't load the swagger.json because it is making requests to http://host/swagger.json and not https://host/swagger.json\r\n\r\nThe endpoints are registered properly with blueprints, because if I manually go to https://host/swagger.json, I get the correct JSON. However, the generated swagger page tries to load the JSON from a http endpoint, instead of the correct https endpoint. \r\n\r\nIs there any way to fix this?\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/noirbizarre/flask-restplus/issues/comments/137503138","html_url":"https://github.com/noirbizarre/flask-restplus/issues/54#issuecomment-137503138","issue_url":"https://api.github.com/repos/noirbizarre/flask-restplus/issues/54","id":137503138,"user":{"login":"noirbizarre","id":15725,"avatar_url":"https://avatars.githubusercontent.com/u/15725?v=3","gravatar_id":"","url":"https://api.github.com/users/noirbizarre","html_url":"https://github.com/noirbizarre","followers_url":"https://api.github.com/users/noirbizarre/followers","following_url":"https://api.github.com/users/noirbizarre/following{/other_user}","gists_url":"https://api.github.com/users/noirbizarre/gists{/gist_id}","starred_url":"https://api.github.com/users/noirbizarre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noirbizarre/subscriptions","organizations_url":"https://api.github.com/users/noirbizarre/orgs","repos_url":"https://api.github.com/users/noirbizarre/repos","events_url":"https://api.github.com/users/noirbizarre/events{/privacy}","received_events_url":"https://api.github.com/users/noirbizarre/received_events","type":"User","site_admin":false},"created_at":"2015-09-03T16:26:37Z","updated_at":"2015-09-03T16:26:37Z","body":"Hi !\r\n\r\nI have multiple instances working in both http and https without any problem.\r\n\r\nI think this is related to Flask/Werkzeug and the way it handles https.\r\n\r\nIf you want https, you need to make sure your reverse-proxy is setting the `X-Forwarded-Proto` header properly.\r\nIf set, Flask/Werkzeug will set the `request.is_secure` to `True` (this is a good way to check this is correctly detected) and `url_for` will return https URLs (in the same request context).\r\n\r\nThe solution you provide should be working, but you won't be able anymore to work in http."}}