server { listen 80; listen [::]:80; server_name example2.com www.example2.com; # Redirect all insecure http:// requests to https:// return 301 https://example2.com$request_uri; return 301 https://www.example2.com$request_uri; } server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name example2.com www.example2.com; root /usr/share/nginx/www; index index.htm index.html; location / { try_files $uri $uri/ =404; } location ~ \.pl$ { gzip off; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/fcgiwrap.socket; } } access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log info; # uncomment lines below if one has iRedmail on server #ssl_certificate /etc/ssl/certs/iRedMail.crt; #ssl_certificate_key /etc/ssl/private/iRedMail.key; #ssl_prefer_server_ciphers on; #ssl_ciphers EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH;