Posts

Nginx - rate limit for connection from different user agent

Hello.  Trying to set a rate limit for user agent using nginx on the Hestia CP . 1. In http section of the main nginx configuration /etc/nginx/nginx.conf add this code http { ...    map $http_user_agent $limit_bots {       default '';       ~*(yandex|msnbot|yahoo) $binary_remote_addr;    }    limit_req_zone $limit_bots zone=bots:10m rate=40r/m; ... } In the configuration file of the vhost  need add this code server { ...    limit_req zone=bots burst=5 nodelay; ... } PS. source article  

TCP checksum incorrect

 https://forum.proxmox.com/threads/intel-nic-e1000e-hardware-unit-hang.106001/

Heads-up: Exim 4.96-4.97 may break your Dovecot LDA delivery

 https://dovecot.org/pipermail/dovecot/2022-April/124592.html

Debian 12 (Proxmox Mail Gateway) and starting mailCow mail service

Hello. If You have a problem with starting the MailCow mail service on the Debian 12 (Proxmox Mail Gateway iso) You can use this article . 1. Need to check what template to use Apparmor root@pmg:/home/user# apparmor_status apparmor module is loaded. 10 profiles are loaded. 9 profiles are in enforce mode. docker-default /usr/bin/freshclam /usr/lib/NetworkManager/nm-dhcp-client.action /usr/lib/NetworkManager/nm-dhcp-helper /usr/lib/connman/scripts/dhclient-script /usr/sbin/clamd /{,usr/}sbin/dhclient lsb_release nvidia_modprobe nvidia_modprobe//kmod 0 profiles are in complain mode 0 profiles are in kill mode. 0 profiles are in unconfined mode. 108 processes have profiles defined. 1 processes are in enforce mode.   2. Create apparmor template in /etc/apparmor.d/docker-default #include <tunables/global> profile docker-default flags=(attach_disconnected,mediate_deleted) { #include <abstractions/base> ptrace peer=@{profile_name}, network, capabi...

Custom outgoing IP from docker container

Image
Hi. If You want to configure a custom docker container to use one public IPs that are located on the host system You can use this schema. First, need install docker engine on the system  - install docker   Next, create docker networks  like this --------------------------------------------------------- docker network create --attachable --opt 'com.docker.network.bridge.name=my-network-1' --opt 'com.docker.network.bridge.enable_ip_masquerade=false' --subnet=172.20.10.0/24 --gateway=172.20.10.1 my-network-1 docker network create --attachable --opt 'com.docker.network.bridge.name=my-network-2' --opt 'com.docker.network.bridge.enable_ip_masquerade=false'   --subnet=172.20.20.0/24 --gateway=172.20.20.1 my-network-2 docker network create --attachable --opt 'com.docker.network.bridge.name=my-network-3' --opt 'com.docker.network.bridge.enable_ip_masquerade=false'  --subnet=172.20.30.0/24 --gateway=172.20.30.1 my-network-3 ------------------------...

Docker certbor autoreNEW cert cron job

Hi. If You using a Portainer for deploy yours applications with nginx, apache and Let’s Encrypt SSL you will need to auto renew the certificates when they were ended. I'm using that bash script and put it in the  /etc/cron.weekly folder (using UBUNTU 22.03)  #!/bin/bash # Set PATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin # Run the certbot container to renew the certs docker run --rm -v certbot-webroot-VOLUME:/var/www/certbot -v certbot-data-VOLUME:/etc/letsencrypt:rw certbot/certbot renew # Restart container docker restart container-WITH-WEB-SERVER # Copy cert for Portainer cat /var/lib/docker/volumes/certbot-data-VOLUME/_data/live/YOUR.DOMAIN.COM/fullchain.pem > /opt/portainer/certs/cert.pem cat /var/lib/docker/volumes/certbot-data/_data/live/YOUR.DOMAIN.COM/privkey.pem > /opt/portainer/certs/key.pem docker restart portainer PS. When You will put script to the   /etc/cron.weekly   folder don't add an extension to the script ...

Seample redirects on the .htaccess

Example simple redirect on the .htaccess using rewrite module of the APACHE (httpd) #redirects of one URL RewriteCond %{REQUEST_URI} ^/madres-subrogadas/ RewriteRule .* https://exanple.com/es/moms/ [R=301,L] #redirect all domain RewriteRule (.*)$ https://example.com/es/ [R=301,L]