Editing
HAProxy
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== HTTPS (port 443) cu SSL Termination în HAProxy === În această situaţie HAProxy gestionează certificatul. ==== Generare certificat Let’s Encrypt ==== Necesită port 80 public și domeniu valid.<br> Certbot, în modul <span style=" font-family: Courier New;">--standalone</span>, pornește un mini‑webserver intern pe portul 80 pentru a răspunde la challenge-ul HTTP‑01 de la Let’s Encrypt.<br> Dacă HAProxy este pornit, acesta ocupă portul 80 și Certbot nu poate porni serverul de validare, ceea ce duce la eșecul generării certificatului. '''Instalare certbot''' <code class="mw-code mw-highlight plainlinks" style="display:block"><!-- --> apt -y install certbot </code> '''Oprire temporară HAProxy''' <code class="mw-code mw-highlight plainlinks" style="display:block"><!-- --> systemctl stop haproxy </code> '''Generare certificat''' <code class="mw-code mw-highlight plainlinks" style="display:block"><!-- --> certbot certonly --standalone -d wiki.stradivart.ro </code> '''Creare fișier PEM pentru HAProxy''' <code class="mw-code mw-highlight plainlinks" style="display:block"><!-- --> # mkdir -p /etc/haproxy/certs  # cat /etc/letsencrypt/live/wiki.stradivart.ro/fullchain.pem \    /etc/letsencrypt/live/wiki.stradivart.ro/privkey.pem \    > /etc/haproxy/certs/wiki.stradivart.ro.pem  # chmod 600 /etc/haproxy/certs/wiki.stradivart.ro.pem </code> ==== Frontend HTTPS (SSL termination) ==== <code class="mw-code mw-highlight plainlinks" style="display:block"><!-- --> frontend https_in     bind *:443 ssl crt /etc/haproxy/certs/wiki.stradivart.ro.pem     mode http     option forwardfor     default_backend http_webserver </code> * *bind :443 ssl crt ... – HAProxy decriptează SSL. * mode http – traficul devine HTTP după terminarea SSL. * default_backend http_webserver – backend-ul HTTP unic. ==== Backend HTTPS (SSL termination) ==== În cazul SSL termination, backend-ul nu procesează trafic HTTPS.<br> HAProxy decriptează SSL în frontend, iar backend-ul primește trafic HTTP normal (non‑SSL).<br> De aceea backend-ul este identic cu backend-ul HTTP. <code class="mw-code mw-highlight plainlinks" style="display:block"><!-- --> backend http_webserver     mode http     balance leastconn     option httpchk GET /     server vm01 192.168.14.11:80 check     server vm02 192.168.14.22:80 check     server vm03 192.168.14.33:80 check </code> * mode http – backend-ul procesează HTTP. * balance leastconn – trimite traficul către serverul cu cele mai puține conexiuni active. * option httpchk GET / – health-check HTTP. * server vm01/vm02/vm03 – cele trei VM.
Summary:
Please note that all contributions to Linux Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Linux Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Navigation
Main page
Aplicatii Linux
UrBackup
rSyslog
KeepAlived
HAProxy
USB over IP
Pi-hole
DHCP
BIND DNS
Hardware Linux
Adaugare Disk
Extindere Disk
Docker
Instalare Docker CE
Portainer
Container UrBackup
Container PiHole
Raspberry Pi
NTP Server
Snippets
History Command
Access Control List
Tools
What links here
Related changes
Special pages
Page information