Add Haproxy cheatsheet
35
Haproxy-cheatsheet.md
Normal file
35
Haproxy-cheatsheet.md
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
|
||||||
|
|
||||||
|
## Agregar un nuevo dominio
|
||||||
|
|
||||||
|
Se debe de agregar 2 secciones de codigo bajo el bloque `frontend public`
|
||||||
|
```
|
||||||
|
#ACL es la regla para definir comportamiento
|
||||||
|
#acl <nombre_acl> regla
|
||||||
|
acl host_test.tequi.xyz hdr_dom(host) -i test.tequi.xyz
|
||||||
|
|
||||||
|
#use_backend define el nombre del backend dependiendo de uno o varios acl
|
||||||
|
#use_backend <nombre_backend> <logic_operator> <acl_name>
|
||||||
|
use_backend test.tequi.xyz if host_test.tequi.xyz
|
||||||
|
```
|
||||||
|
|
||||||
|
y se debe agregar un bloque `backend`
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
#backend <backend_name>
|
||||||
|
#- option forwardfor
|
||||||
|
#- server <server_name> <ip>:<port>
|
||||||
|
#
|
||||||
|
#
|
||||||
|
backend test.tequi.xyz
|
||||||
|
option forwardfor
|
||||||
|
server test.tequi.xyz_server localhost:8082
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
**## Borrar dominio**
|
||||||
|
Quita todas las referencias del dominio
|
||||||
|
|
||||||
|
|
||||||
|
Para que los cambios sean aplicados se debe de reiniciar haproxy con `systemctl restart haproxy`
|
||||||
Reference in New Issue
Block a user