Replace edge proxy with nginx
The config makes more sense, and it has more of the features I need, which will come later.
This commit is contained in:
@ -1,4 +0,0 @@
|
||||
[Definition]
|
||||
|
||||
failregex = ^.*haproxy\[[0-9]+\]: <HOST>:.*$
|
||||
ignoreregex =
|
@ -1,41 +0,0 @@
|
||||
global
|
||||
log /dev/log local0
|
||||
log /dev/log local1 notice
|
||||
pidfile /run/haproxy.pid
|
||||
stats timeout 30s
|
||||
user haproxy
|
||||
group haproxy
|
||||
daemon
|
||||
maxconn 10000
|
||||
|
||||
defaults
|
||||
log global
|
||||
mode http
|
||||
option httplog
|
||||
option dontlognull
|
||||
|
||||
listen https
|
||||
bind *:443
|
||||
mode tcp
|
||||
timeout http-request 10m
|
||||
timeout connect 10m
|
||||
timeout client 10m
|
||||
timeout server 10m
|
||||
server default {{ wireguard.clients.ingress.ip }}:8443 send-proxy-v2
|
||||
|
||||
listen http
|
||||
bind *:80
|
||||
stats enable
|
||||
stats show-node
|
||||
stats uri /haproxy
|
||||
stats auth stats:{{ haproxy.stats_pass }}
|
||||
timeout http-request 10m
|
||||
timeout connect 10m
|
||||
timeout client 10m
|
||||
timeout server 10m
|
||||
server default {{ wireguard.clients.ingress.ip }}:880 send-proxy-v2
|
||||
|
||||
listen matrix
|
||||
bind *:8448
|
||||
mode tcp
|
||||
server default {{ wireguard.clients.ingress.ip }}:8443 send-proxy-v2
|
4
ansible/roles/gateway/files/nginx-fail2ban-filter.conf
Normal file
4
ansible/roles/gateway/files/nginx-fail2ban-filter.conf
Normal file
@ -0,0 +1,4 @@
|
||||
[Definition]
|
||||
|
||||
failregex = ^<HOST> .*$
|
||||
ignoreregex =
|
@ -1,16 +1,14 @@
|
||||
[haproxy]
|
||||
[nginx]
|
||||
enabled = true
|
||||
bantime = 600
|
||||
findtime = 10
|
||||
maxretry = 100
|
||||
filter = haproxy-basic
|
||||
backend = systemd
|
||||
journalmatch = _COMM=haproxy
|
||||
filter = nginx-tcp
|
||||
logpath = /var/log/nginx/ips.log
|
||||
port = http,https,8448
|
||||
ignoreip = {{ wireguard.cidr }},{{ nebula.cidr }},{{ pve_hosts.internal_cidr }}
|
||||
|
||||
[traefik]
|
||||
enabled = true
|
||||
filter = haproxy-basic # Not actually used
|
||||
port = http,https,8448
|
||||
ignoreip = {{ wireguard.cidr }},{{ nebula.cidr }},{{ pve_hosts.internal_cidr }}
|
57
ansible/roles/gateway/files/nginx.conf
Normal file
57
ansible/roles/gateway/files/nginx.conf
Normal file
@ -0,0 +1,57 @@
|
||||
worker_processes {{ ansible_processor_nproc }};
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
# '$status $body_bytes_sent "$http_referer" '
|
||||
# '"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
#access_log logs/access.log main;
|
||||
|
||||
sendfile on;
|
||||
#tcp_nopush on;
|
||||
|
||||
#keepalive_timeout 0;
|
||||
keepalive_timeout 65;
|
||||
|
||||
#gzip on;
|
||||
|
||||
}
|
||||
|
||||
stream {
|
||||
|
||||
log_format access '$remote_addr [$time_local] '
|
||||
'$protocol $status $bytes_sent $bytes_received '
|
||||
'$session_time "$upstream_addr" '
|
||||
'"$upstream_bytes_sent" "$upstream_bytes_received" "$upstream_connect_time"';
|
||||
|
||||
log_format ips '$remote_addr [$time_local] $upstream_addr';
|
||||
|
||||
|
||||
access_log /var/log/nginx/access.log access;
|
||||
access_log /var/log/nginx/ips.log ips;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
proxy_pass {{ wireguard.clients.ingress.ip }}:880;
|
||||
proxy_protocol on;
|
||||
}
|
||||
server {
|
||||
listen 443;
|
||||
proxy_pass {{ wireguard.clients.ingress.ip }}:8443;
|
||||
proxy_protocol on;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 8448;
|
||||
proxy_protocol on;
|
||||
proxy_pass {{ wireguard.clients.ingress.ip }}:8443;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user