From d71d6dfbd6d0264d24a0a253fa1ffaa51a67d8b4 Mon Sep 17 00:00:00 2001 From: Triono Putra Date: Wed, 4 Jun 2025 19:02:54 +0700 Subject: [PATCH] oks --- nginx/default.conf | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/nginx/default.conf b/nginx/default.conf index e38b280..8a09ac7 100644 --- a/nginx/default.conf +++ b/nginx/default.conf @@ -1,24 +1,37 @@ server { listen 80; - index index.php index.html; server_name siska.appstaging.my.id; - - # Ensure this matches your actual document root - root /var/www/public; + root /var/www/public; + index index.php index.html index.htm; + + # Log + access_log /var/log/nginx/access.log; + error_log /var/log/nginx/error.log; + + # Try static file, else fallback to Laravel location / { try_files $uri $uri/ /index.php?$query_string; } + # PHP-FPM location ~ \.php$ { + include fastcgi_params; fastcgi_pass sistem-akademik-dev:9000; fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; - include fastcgi_params; } - location ~ /\.ht { + # Deny access to .env and sensitive files + location ~ /\. { deny all; } -} \ No newline at end of file + + location ~* \.(log|git|env|ini|bak|sql)$ { + deny all; + } + + # Increase upload size if needed + client_max_body_size 50M; +}