title: Traefik 2.4: redirect http to https based on IP / Header
body: <p>Im using traefik with a global redirect from http to https, using this commands in docker-compose file</p>
  <pre><code>      - &quot;--entrypoints.web.http.redirections.entryPoint.to=websecure&quot;
        - &quot;--entrypoints.web.http.redirections.entryPoint.scheme=https&quot;
        - &quot;--entrypoints.web.http.redirections.entrypoint.permanent=true&quot;
  </code></pre>
  <p>Which works just fine.</p>
  <p>Now, is there a possiblity to make this global redirect rule-based? I want to <strong>redirect</strong> all traffic from <strong>http to https</strong>, <strong>but if a specific header</strong> is presented <strong>or</strong> the request comes from a <strong>specific IP</strong>, the redirect should <strong>not take place</strong>.</p>