server { listen 192.4.1.6:80; server_name mail.mydomen.ru; if ($http_host !~ "^mail.mydomen.ru$"){ rewrite ^(.*)$ http://mail.mydomen.ru$1 redirect; } root /home/wwwmails/mail-mydomen; error_log /var/log/nginx/err-mail_mydomen_ru.log; access_log /var/log/nginx/access-mail_mydomen_ru.log; include /etc/nginx/templates/content.conf; include /etc/nginx/templates/letsencrypt.conf; }