title: Flask url_for generating http URL instead of https
body: <p>I am using <code>url_for</code> to generate a redirect URL when a user has logged out:</p>
  
  <pre><code>return redirect(url_for('.index', _external=True))
  </code></pre>
  
  <p>However, when I changed the page to a <em>https</em> connection, the <code>url_for</code> still gives me <em>http</em>.</p>
  
  <p>I would like to explicitly ask <code>url_for</code> to add <em>https</em> at the beginning of a URL.</p>
  
  <p>Can you point me how to change it? I looked at Flask docs, without luck.</p>