/etc/haproxy/.
Create a directory
Perform the following steps to create a directory for HAProxy TLS PKI:Edit the configuration file
Perform the following steps to edit the HAProxy configuration file:Configure HAProxy to use pkcs11-provider by defining the following lines in the
global section:None
At the bottom of the file, define the frontend and backend configuration:The following points explain aspects of the preceding code:-bind *:443 ssl crt /etc/haproxy/tls/haproxy-cert.pem
None
- This instructs HAProxy to listen on port 443 using SSL, loading the certificate from
/etc/haproxy/tls/haproxy-cert.pem. HAProxy knows how to find the/etc/haproxy/tls/haproxy-cert.pem.keyfile because you gave it the same file name as the certificate, but with the.keyextension. - mode http ensures that HAProxy treats traffic as HTTP after decryption.
- default_backend webservers sends traffic to a backend block named
webservers. - The backend block can forward requests to one or more servers (in this case, only
127.0.0.1:8080). For testing purposes, you can spin up a web server by running the following command in a separate terminal window:
Shell

