server { listen 80; server_name example.com www.example.com mail.example.com; return 301 https://example.com$request_uri; return 301 https://www.example.com$request_uri; } server { listen 443 ssl; listen [::]:443 ssl; server_name example.com www.example.com; root /var/www/wordpress; index index.php index.html index.htm; #location = /favicon.ico { log_not_found off; access_log off; } #location = /robots.txt { log_not_found off; access_log off; allow all; } location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ { expires max; log_not_found off; } location / { #try_files $uri $uri/ =404; try_files $uri $uri/ /index.php$is_args$args; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass 127.0.0.1:9999; #fastcgi_pass unix:/var/run/php/php7.3-fpm.sock; } include /etc/nginx/templates/misc.tmpl; include /etc/nginx/templates/ssl.tmpl; include /etc/nginx/templates/iredadmin.tmpl; include /etc/nginx/templates/roundcube.tmpl; include /etc/nginx/templates/sogo.tmpl; include /etc/nginx/templates/netdata.tmpl; include /etc/nginx/templates/php-catchall.tmpl; include /etc/nginx/templates/stub_status.tmpl; #ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot #ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot #ssl_certificate /etc/ssl/certs/iRedMail.crt; #ssl_certificate_key /etc/ssl/private/iRedMail.key; }