-
Notifications
You must be signed in to change notification settings - Fork 0
bot blocking inginx configuration #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces bot blocking and enhanced security measures to the Nginx configuration for the analytics production environment.
- Added rate-limiting configuration to mitigate aggressive scraping
- Configured conditional blocking for requests based on user agent and header patterns
- Introduced additional security headers and conditional logging for blocked requests
Comments suppressed due to low confidence (1)
deploy/deploy-scripts/analytics-prod.yml:141
- The conditional logging directive references the variable '$blocked_ua', which appears undefined. Please ensure that this variable is properly defined to enable conditional logging as intended.
access_log /var/log/nginx/analytics-blocked.log combined if=$blocked_ua;
| if ($http_referer = "" AND $request_method = "GET" AND $args ~ "(select|union|insert|delete|update|drop|create|alter)") { | ||
| return 403; |
Copilot
AI
Jun 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of 'AND' to combine multiple conditions in the if directive may not work as expected in Nginx. Consider rewriting the condition using separate if blocks or a supported technique to combine conditions.
| if ($http_referer = "" AND $request_method = "GET" AND $args ~ "(select|union|insert|delete|update|drop|create|alter)") { | |
| return 403; | |
| if ($http_referer = "") { | |
| if ($request_method = "GET") { | |
| if ($args ~ "(select|union|insert|delete|update|drop|create|alter)") { | |
| return 403; | |
| } | |
| } |
No description provided.