server { listen 194.4.1.6:443 ssl proxy_protocol; server_name mydomen.ru www.mydomen.ru; set_real_ip_from 91.193.62.251; real_ip_header proxy_protocol; include /etc/nginx/ssl/ssl_mydomen-ru.conf; if ( $scheme = "http" ) { rewrite ^/(.*)$ https://$host/$1 permanent; } ssi on; server_name mydomen.ru; if ($http_host !~ "^mydomen.ru$"){ rewrite ^(.*)$ http://mydomen.ru$1 redirect; } root /home/www/mydomen; error_log /var/log/nginx/err-mydomen_ru.log; access_log /var/log/nginx/access-mydomen_ru.log; include /etc/nginx/templates/content.conf; include /etc/nginx/templates/letsencrypt.conf; }