vi /etc/nginx/nginx.conf
Change limit_conn_zone $binary_remote_address zone=addr:10m; to
limit_conn_zone $http_x_forwarded_for zone=addr:10m;
vi /etc/nginx/nginx.conf
Change limit_conn_zone $binary_remote_address zone=addr:10m; to
limit_conn_zone $http_x_forwarded_for zone=addr:10m;
You should better change it to “$binary_remote_addr”, which is the correct spelling of the variable’s name (see http://nginx.org/en/docs/http/ngx_http_core_module.html).
If one don’t use nginx as a reverse proxy, there is no “$http_x_forwarded_for” header at all.