Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4720

Http to https on same frontend port

$
0
0

Hi all,

I’m trying to set up HAproxy to send all http request to https follow the same link and port. For example:

http://exmple.local:9443 —> https://exmple.local:9443

Here is my configuration:

frontend example
bind *:9443 ssl crt /etc/haproxy/example.pem

Example app

acl is_example path -i -m beg /example
use_backend example_backend if is_example

backend example_backend
mode http
balance roundrobin
server example01 host:9443 check ssl verify none
server example02 host:9443 check ssl verify none
http-request set-header X-Forwarded-Port %[dst_port]
http-request add-header X-Forwarded-Proto https if { ssl_fc }

In addiion, i have tried:

redirect scheme https code 301 if !{ ssl_fc }
http-request add-header X-Forwarded-Proto https

HAproxy version HA-Proxy version 2.1.4.
OS: Suse Ent. 15 SP1

Please, suggest configuration.

BR.

2 posts - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 4720

Trending Articles



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