limit_conn with variables erroring with invalid number of connections

justink101 nginx-forum at
Mon Apr 24 01:14:20 UTC 2017

Here is the configuration:

http {
    limit_conn_zone $binary_remote_addr zone=limitapinoauth:16m;
    limit_conn_zone $remote_user zone=limitapi:32m;
    map $remote_user $limit_zone {
        default   limitapi;
        ''        limitapinoauth;

    map $remote_user $limit_number {
        default   100;
        ''        200;

server {
    limit_conn $limit_zone $limit_number;

When starting NGINX getting a fatal error though. Does limit_conn support
using variables?

error => invalid number of connections "$limit_number"

Posted at Nginx Forum:,273805,273805#msg-273805

More information about the nginx mailing list