The kern.ipc.somaxconn might not do what you think it does. It is the limit to outstanding and unhandled connections. (e.g.. it is not a connection limit, but the pending handle connection limit).
To use a non computer analogy: It is the maximum number of ringing phones (before they are picked up and answered), not the number of maximum simultaneous phone calls.
If you have backlog that is that big then your need to let your application pick up the phone more often (e.g. give it more resources, more CPU, better framework, whatever).
Note that the FreeBSD handbook section on kernel limits states this: (Emphasis mine).
The kern.ipc.somaxconn sysctl variable limits the size of the listen
queue for accepting new TCP connections. The default value of 128
is typically too low for robust handling of new connections in a
heavily loaded web server environment. For such environments, it is
recommended to increase this value to 1024 or higher. The service
daemon may itself limit the listen queue size
I have no experience with Nginx, but also check its configuration files for above mentioned limit from the application side.