File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments