Quantcast
Viewing all articles
Browse latest Browse all 4731

Bad gateway in Chrome and Edge when redirect http to https

Hi!

I made a simple configuration to redirect any incoming http traffic to https using some certs using this simple configuration.

global
    log         127.0.0.1 local1

defaults
    log     global
    mode    http
    option  httplog

frontend http_https
    bind 172.17.0.2:80
    bind 172.17.0.2:443 ssl crt /etc/haproxy/certs/
    http-request redirect scheme https unless { ssl_fc }

    default_backend drive_server

backend drive_server    
    server synodrive01 192.168.6.97:10002

While this works using the URL drive.mydomain.de I get a proper redirection using the latest Firefox in Windows 10 Pro, this does not work using Edge or Chrome.

Both browsers return a 502 Bad Gateway, no matter if I use https://drive.mydomain.de or http://drive.mydomain.de

While opening the URL in Edge or Chrome, I don’t even get any log output in /var/log/haproxy, at least not at the time of pressing enter to open the web page.

When the 502 raises, the following lines where logged.

May 17 20:49:55 localhost haproxy[25280]: 166.66.111.239:47938 [17/May/2021:20:49:45.671] http_https~ drive_server/synodrive01 0/0/4/-1/10011 502 214 - - SH-- 2/2/0/0/0 0/0 "GET / HTTP/1.1" 
May 17 20:50:25 localhost haproxy[25280]: 166.66.111.239:48132 [17/May/2021:20:50:15.912] http_https~ drive_server/synod rive01 0/0/1/-1/10011 502 214 - - SH-- 1/1/0/0/0 0/0 "GET /favicon.ico HTTP/1.1"

Strange enough, when choosing mode tcp in config, all runs well, however, without http to https redirection of course. The log gives me this output:

May 17 20:58:45 localhost haproxy[26525]: 166.66.111.239:44458 [17/May/2021:20:58:32.764] http_https drive_server/synodrive01 1/1/12794 26494 -- 10/10/9/9/0 0/0

So whats the deal with Edge and Chrome? I understand that probably both browsers are using the same engine underneath and Firefox works because of its own engine.

But this does not fully explain why Chrome/Edge result in a 502 error.

Any hints are highly appreciated since I’m already pulling my hairs out for quite a while now Image may be NSFW.
Clik here to view.
:wink:

Thanks,
Michael

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 4731

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>