Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl-rest
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl-rest
Commits
9a54729e
Commit
9a54729e
authored
12 years ago
by
Andy Yates
Browse files
Options
Downloads
Patches
Plain Diff
/ is also not rate limtied (only when it is / alone)
parent
e2204ee4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
configurations/production/ensrest.psgi
+8
-8
8 additions, 8 deletions
configurations/production/ensrest.psgi
with
8 additions
and
8 deletions
configurations/production/ensrest.psgi
+
8
−
8
View file @
9a54729e
...
...
@@ -9,9 +9,12 @@ use Plack::Builder;
use Plack::Util;
use Plack::Middleware::Throttle::Backend::Memcached;
my $app =
EnsEMBL::REST->apply_default_middlewares(
EnsEMBL::REST->psgi_app
)
;
my $app = EnsEMBL::REST->psgi_app;
builder {
#------ Set appropriate headers when we detect REST is being used as a ReverseProxy
enable "Plack::Middleware::ReverseProxy";
my $dirname = dirname(__FILE__);
my $rootdir = File::Spec->rel2abs(File::Spec->catdir($dirname, File::Spec->updir(), File::Spec->updir()));
...
...
@@ -33,8 +36,8 @@ builder {
message => 'You have exceeded your limit which is 11,100 requests per hour (~3 per second)',
path => sub {
my ($path) = @_;
return 1 if $path e
q
'/';
return 1 if $path !~ /\/(?:documentation|static)/;
return 1 if $path
n
e '/';
return 1 if $path !~ /\/(?:documentation|static
|_asset
)/;
return 0;
}
);
...
...
@@ -55,8 +58,8 @@ builder {
message => 'You have exceeded the limit of 6 requests per second; please reduce your concurrent connections',
path => sub {
my ($path) = @_;
return 1 if $path e
q
'/';
return 1 if $path !~ /\/(?:documentation|static)/;
return 1 if $path
n
e '/';
return 1 if $path !~ /\/(?:documentation|static
|_asset
)/;
return 0;
}
);
...
...
@@ -72,9 +75,6 @@ builder {
check_every_n_requests => 10,
);
#------ Make uri_for do the right thing -- COMMENTED OUT SINCE apply_default_middlewares() BRINGS IT IN
#enable "Plack::Middleware::ReverseProxy";
#------ Adds a better stack trace
enable 'StackTrace';
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment