add haproxy config

This commit is contained in:
LinuxSquare 2024-02-22 21:51:05 +01:00
parent 7f1dc9e842
commit da1c001330
3 changed files with 50 additions and 2 deletions

View file

@ -0,0 +1,38 @@
global
log 127.0.0.1 local2
maxconn 4000
user haproxy
group haproxy
daemon
stats socket /var/lib/haproxy/stats
defaults
mode http
log global
timeout queue 1m
timeout connect 10s
timeout client 5m
timeout server 5m
maxconn 3000
frontend ssh
mode tcp
bind 192.168.122.62:22
default_backend ssh
frontend http
mode tcp
bind 192.168.122.62:80
default_backend http
backend ssh
mode tcp
server localhost 127.0.0.1
backend http
mode tcp
server localhost 127.0.0.1

View file

@ -15,6 +15,15 @@ haproxy_pkg_conf_dir:
- require: - require:
- haproxy_pkg_pkgs - haproxy_pkg_pkgs
haproxy_pkg_config:
file.managed:
- name: /etc/haproxy/haproxy.cfg
- user: root
- group: root
- mode: '0644'
- require:
- haproxy_pkg_pkgs
haproxy_pkg_rc_script: haproxy_pkg_rc_script:
file.managed: file.managed:
- name: /etc/init.d/haproxy - name: /etc/init.d/haproxy
@ -28,3 +37,4 @@ haproxy_pkg_rc_script:
- mode: '0755' - mode: '0755'
- require: - require:
- haproxy_pkg_conf_dir - haproxy_pkg_conf_dir
- haproxy_pkg_config

View file

@ -18,9 +18,9 @@ Include /etc/ssh/sshd_config.d/*.conf
# SELinux about this change. # SELinux about this change.
# semanage port -a -t ssh_port_t -p tcp #PORTNUMBER # semanage port -a -t ssh_port_t -p tcp #PORTNUMBER
# #
#Port 22 Port 22
#AddressFamily any #AddressFamily any
#ListenAddress 0.0.0.0 ListenAddress 127.0.0.1
#ListenAddress :: #ListenAddress ::
#HostKey /etc/ssh/ssh_host_rsa_key #HostKey /etc/ssh/ssh_host_rsa_key