Skip to content

Instantly share code, notes, and snippets.

@adinata-id
Created December 26, 2025 09:31
Show Gist options
  • Select an option

  • Save adinata-id/ba42df24c1eda95a67cf8553bc3f2ef9 to your computer and use it in GitHub Desktop.

Select an option

Save adinata-id/ba42df24c1eda95a67cf8553bc3f2ef9 to your computer and use it in GitHub Desktop.
Batasi akses langsung ke file-file shell nginx
# Batasi akses langsung ke file-file shell
location ~ ^/(bench\.sh|rdp\.sh|rdpn\.sh|arm\.sh|armn\.sh|cpcleanup\.sh|cleanup_lsphp_sessions\.sh|speedtest\.sh|mmac\.sh|autocleanup\.sh|ioncube\.sh|yabs\.sh)$ {
set $deny_access 1;
if ($http_user_agent ~* "(wget|curl)") {
set $deny_access 0;
}
if ($deny_access = 1) {
return 403;
}
root /var/www/your_path_website; # GANTI jika root folder-nya beda
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment