Author: jan

Dynamic routes with nginx


This Nginx configuration file below allows for wildcard hostnames that dynamically route to the corresponding folder in /var/www/vhost/ while also dynamically generating the respective log files. → /var/www/vhost/test1
                                                   /var/log/nginx/                                                   /var/log/nginx/ → /var/www/vhost/test2
                                                   /var/log/nginx/                                                   /var/log/nginx/


server {
  listen 80;
  listen [::]:80;

  #  Match everything except dot and store in $subdomain variable
  #  Matches,
  #  Ignores
  server_name ~^(?<subdomain>[^.]+);

  root /var/www/vhost/$subdomain;

  access_log /var/log/nginx/$host-access.log;
  error_log  /var/log/nginx/$host-error.log;

Additional links:

Filter mailing lists with Dovecot Sieve

require ["fileinto", "variables"];

if header :matches "List-Post" "*<mailto:**@*.*.*>" {
  fileinto "INBOX.lists.${5}.${3}"; stop;

if header :matches "List-Post" "*<mailto:**@*.*>" {
  fileinto "INBOX.lists.${4}.${3}"; stop;

if header :matches "X-Mailing-List" "*@*.*.*" {
  fileinto "INBOX.lists.${3}.${1}"; stop;

if header :matches "X-Mailing-List" "*@*.*" {
  fileinto "INBOX.lists.${2}.${1}"; stop;

Teamspeak Dockerfile > Healthcheck

FROM teamspeak

RUN apk --update --no-cache add netcat-openbsd

HEALTHCHECK --interval=15s --timeout=1s --start-period=5s --retries=3 CMD echo quit | nc 10011 || false
# docker ps --filter ancestor=teamspeak

CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS                 PORTS                                                                        NAMES
748e7f873a07        teamspeak_teamspeak   " ts3se…"   5 hours ago         Up 5 hours (healthy)>10011/tcp,>9987/udp,>30033/tcp   dvaec_teamspeak

fail2ban – Proxmox Webinterface

enabled = true
port = 8006
filter = proxmox
logpath = /var/log/daemon.log
maxretry = 3
bantime = 86400
failregex = pvedaemon\[.*authentication failure; rhost=<HOST> user=.*msg=.*
ignoreregex =