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

What's the canonical way to handle port 80 and port 443?

$
0
0

@realtebo wrote:

I am doing this

frontend http
        bind *:80
        option forwardfor

        acl acl_pihole2_http hdr(host) -i pihole2.mydomain.tld
        use_backend pihole2_http if acl_pihole2_http

frontend https   
        bind *:443
        option forwardfor

        acl acl_pihole2_https hdr(host) -i pihole2.mydomain.tld
        use_backend pihole2_https if acl_pihole2_https

backend pihole2_http
        server web 192.168.1.228:80 check

backend pihole2_https
        server web 192.168.1.228:443 check

It’s working well, even certbot running on the ,228.

I ask you a kindle opinion about configuration. It’s my first days in HAProxy and I’d like to start with right direction.

To be more precise: do I need a separate frontend and backend section? Cannot I simple listen to 80 and 443 ina single frontend and use a single backend ?

Also, I forced a 301 redirect from http to https in the server. Is it right or must I do it here at HAProxy level?

Thanks in advance

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4739

Trending Articles



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