Skip to content

Instantly share code, notes, and snippets.

@felipekm
Created February 28, 2025 14:02
Show Gist options
  • Save felipekm/b0b348dfbd6e6364528ee504ad66a72e to your computer and use it in GitHub Desktop.
Save felipekm/b0b348dfbd6e6364528ee504ad66a72e to your computer and use it in GitHub Desktop.
NGINX - Enhance security by blocking malicious requests and logging threats.
server {
location /api/ {
deny 192.168.1.100; # Block specific IPs
error_page 403 /403.html;
access_log /var/log/nginx/api.log; # Log all requests
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment