Hi, On 18/10/2017 20:22, Benoît Vézina wrote: > Hi, > > I did spend a lot (I really mean a lot) trying to make work Odoo > webslide behind Haproxy but I still end put an nginx cause that module > is sending javascript that call stuff in http instead of https. > > In the nginx world I have to had that to my server section and all the > rewrite is done fine: > > proxy_set_header X-Forwarded-Proto $scheme; This can be expressed in HAProxy by the following two lines:
|http-request set-header X-Forwarded-Proto https if { ssl_fc } ||http-request set-header X-Forwarded-Proto http if !{ ssl_fc } ||| > So do I have to installed a nginx between haproxy and odoo to do the > rewrite or do it is a way to do it in haproxy. > > Here is my frontend and backend section > > frontend 443 > bind *:443 ssl crt /etc/haproxy/certs/current/xtremxpert.pem ssl crt > /etc/haproxy/certs/current > reqadd X-Forwarded-Proto:\ https > mode http > acl 443_xtremxpert_com__host hdr(host) -i xtremxpert.com > acl 443_xtremxpert_com__host hdr(host) -i xtremxpert.com:443 > use_backend 443_xtremxpert_com_ if 443_xtremxpert_com__host > > backend 443_xtremxpert_com_ > acl forwarded_proto hdr_cnt(X-Forwarded-Proto) eq 0 > acl forwarded_port hdr_cnt(X-Forwarded-Port) eq 0 > http-request add-header X-Forwarded-Port %[dst_port] if forwarded_port > http-request add-header X-Forwarded-Proto https if { ssl_fc } > forwarded_proto > mode http > server 03bfdfc9400011968ca41e78cca5cf00dc68b773 10.42.179.224:8069 > > It is not clear what you want to do here, if you just want to send the X-Forwarded-Proto with the corresponding scheme then you already have the answer, otherwise we need more details about your problem. ++ -- Moemen MHEDHBI