HEX
Server: nginx/1.18.0
System: Linux mail.dakarash.co.id 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64
User: www-data (33)
PHP: 8.1.2-1ubuntu2.23
Disabled: NONE
Upload Files
File: //etc/nginx/sites-available/webmail.dakarash.co.id.conf
# === HTTP tanpa redirect ===
server {
    if ($host = webmail.dakarash.co.id) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


  listen 80;
  server_name webmail.dakarash.co.id;

  root /var/www/snappymail;
  index index.php;
  client_max_body_size 60M;

  location / { try_files $uri $uri/ /index.php?$args; }

  location ~ \.php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/run/php/php8.1-fpm.sock;
  }

  # lindungi folder sensitif bila ada
  location ~* ^/(data|config|logs|temp)/ { deny all; }


}

# === HTTPS TANPA redirect (aktifkan hanya jika sertifikat sudah ada) ===
server {
  listen 443 ssl http2;
  server_name webmail.dakarash.co.id;

  ssl_certificate     /etc/letsencrypt/live/webmail.dakarash.co.id/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/webmail.dakarash.co.id/privkey.pem;

  root /var/www/snappymail;
  index index.php;
  client_max_body_size 60M;

  location / { try_files $uri $uri/ /index.php?$args; }

  location ~ \.php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/run/php/php8.1-fpm.sock;
  }

  location ~* ^/(data|config|logs|temp)/ { deny all; }

    ssl_certificate /etc/letsencrypt/live/webmail.dakarash.co.id/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/webmail.dakarash.co.id/privkey.pem; # managed by Certbot
}