Skip to content

Commit

Permalink
Add limit_except and limit_rate
Browse files Browse the repository at this point in the history
  • Loading branch information
willnode committed Oct 2, 2024
1 parent bcebb01 commit fdd440e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "domcloud-bridge",
"version": "0.61.0",
"version": "0.62.0",
"description": "Deployment runner for DOM Cloud",
"main": "app.js",
"engines": {
Expand Down
13 changes: 12 additions & 1 deletion src/executor/nginx.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ const passengerKeys = [
];
const locationKeys = [
"root", "alias", "rewrite", "try_files", "return", "index",
"expires", "allow", "deny", "autoindex", "proxy_pass"
"expires", "allow", "deny", "autoindex", "proxy_pass",
"limit_except", "limit_rate", "limit_rate_after"
];
const sslNames = ["", "off", "always", "on"];
const wwwNames = ["", "off", "always", "on"];
Expand All @@ -49,6 +50,16 @@ class NginxExecutor {
} else if (/^http:\/\/127\.\d+\.\d+\.\d+:\d+(\$.+|\/.+)?$/.test(config[key])) {
node._add(key, config[key]);
}
} else if (key == "limit_except") {
node._add(key, config[key], [{
children: null,
comments: null,
isBlock: false,
isVerbatim: false,
name: "deny",
parent: null,
value: "all",
}]);
} else {
node._add(key, config[key]);
}
Expand Down
3 changes: 3 additions & 0 deletions test/nginx.d/complex.net.conf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ server {
passenger_env_var HTTP_SECURITY_AAAAA 'public';
passenger_env_var HTTP_SECURITY_BBBBB 'public';
passenger_env_var HTTP_SECURITY_LEVEL 'public';
limit_except GET POST {
deny all;
}
}
location ~ \.php(/|$) {
try_files $uri =404;
Expand Down

0 comments on commit fdd440e

Please sign in to comment.