Skip to content

Commit 39afd02

Browse files
committed
warpctl: config fix rate limit exclusions
1 parent 50933f0 commit 39afd02

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

warpctl/config.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,11 +1758,11 @@ func (self *NginxConfig) addRateLimits() {
17581758
// define the $limit_key
17591759
// excluded prefixes are mapped to "" which nginx interprets to apply no limits
17601760
self.raw(`
1761-
map $binary_remote_addr $limit_key {
1761+
geo $limit_key {
17621762
`)
17631763
for _, excludePrefix := range rateLimit.excludePrefixes() {
17641764
self.raw(`
1765-
"{{.prefix}}" "";
1765+
{{.prefix}} "";
17661766
`, map[string]any{
17671767
"prefix": excludePrefix,
17681768
})
@@ -1794,6 +1794,7 @@ func (self *NginxConfig) addRateLimits() {
17941794
if 0 < rateLimit.NetConnections {
17951795
self.raw(`
17961796
# connection limiting
1797+
limit_conn_status 429;
17971798
limit_conn_zone $limit_key zone=standardconnlimit:256m;
17981799
limit_conn standardconnlimit {{.connections}};
17991800
`, map[string]any{

0 commit comments

Comments
 (0)