title: haproxy : http frontend to https backend
body: <p>This is the exact same question as <a href="https://stackoverflow.com/questions/47094066/http-request-to-https-request-using-haproxy">http request to https request using haproxy</a></p>
  <p>However, the accepted answer does not work for me and I dont understand why</p>
  <p>haproxy.cfg:</p>
  <pre><code>global
    daemon
    maxconn 15
    defaults
    mode tcp
    balance first
  
  frontend google
    bind *:10005
    default_backend google-url
  
  backend google-url
    server xxx google.com:443 ssl verify none
  </code></pre>
  <p>when I call <code>curl --location --request GET 'http://localhost:10005'</code>, I receive a response that comes from google but with a 404 status</p>
  <blockquote>
  <p>The requested URL / was not found on this server. That’s all we know.</p>
  </blockquote>
  <p>I tried both mode tcp and mode http, same result</p>
  <p>If I activate the logs with</p>
  <pre><code>  mode http
    bind *:10005
    default_backend google-url  
    option httplog
    log stdout format raw local0
  </code></pre>
  <p>I have this</p>
  <pre><code>  127.0.0.1:52588 [16/Jun/2022:08:24:49.976] google google-url/xxx 0/0/49/20/69 404 1884 - - ---- 2/2/0/0/0 0/0 &quot;GET / HTTP/1.1&quot;
    127.0.0.1:52588 [16/Jun/2022:08:24:49.938] google google/&lt;NOSRV&gt; -1/-1/-1/-1/1038 400 0 - - CR-- 2/2/0/0/0 0/0 &quot;&lt;BADREQ&gt;&quot;
  </code></pre>
  <p>In case this has some impact, I'm running haproxy in kubernetes and then I &quot;port-forward&quot; 10005 (but this does not seem to be the issue because the logs demonstrate that haproxy is correctly receiving the request and using the correct backend...)</p>