Skip to content

Add shortlist of user-agent rate limit#12115

Merged
mekarpeles merged 2 commits intointernetarchive:masterfrom
cdrini:fix/prod-fixes
Mar 17, 2026
Merged

Add shortlist of user-agent rate limit#12115
mekarpeles merged 2 commits intointernetarchive:masterfrom
cdrini:fix/prod-fixes

Conversation

@cdrini
Copy link
Copy Markdown
Collaborator

@cdrini cdrini commented Mar 17, 2026

Moves this from prod onto here.

Requires https://github.com/internetarchive/olsystem/pull/317

Technical

Testing

This was roughly tested, but has since been cleaned up and tightened, so there might be adjustments that need to be made.

Screenshot

Stakeholders

Copilot AI review requested due to automatic review settings March 17, 2026 18:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an additional nginx rate-limiting layer keyed off a shortlist of user agents (intended to be more permissive than the default), and tightens some request classification rules in the nginx frontend configs used by the dockerized deployment.

Changes:

  • Add a new ua_rate_limit limit zone and apply it to / and API/JSON requests.
  • Make “sus user agent” matching case-insensitive for specific blocked UAs.
  • Treat mode=all requests as requiring referrer checks (via $requires_referer mapping).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
docker/web_nginx.conf Updates UA matching, adds mode=all to the “requires referrer” classifier, and applies the new ua_rate_limit in key locations.
docker/nginx.conf Adds an include expected to define $ua_rate_limit_key and defines the new ua_rate_limit zone.

@mekarpeles mekarpeles merged commit 7466a57 into internetarchive:master Mar 17, 2026
7 checks passed
@cdrini cdrini deleted the fix/prod-fixes branch March 17, 2026 19:37
cdrini added a commit to cdrini/openlibrary that referenced this pull request Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants