This article serves to explain how to increase the Nginx worker_connections value.
1. Connect to your server via SSH as the root user or a sudoers user.
2. locate the Nginx configuration files, namely located here at /etc/nginx/nginx.conf, and make a backup before any edits are made.
cp -v /etc/nginx/nginx.conf /etc/nginx/nginx.conf.fresh.backup
3. open the file via a text editor and locate the 'worker_connections' variable.
grep worker_connection /etc/nginx/nginx.conf
4. Change the value from 1024 (default) to the new value; incrementally doubling the value is typically the best path unless a system administrator provides an exact value.
5. Save the file and verify the Nginx configuration with nginx -t, if the syntax is ok and the test is successful similar to the output below, move on to step 6.
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
6. Restart Nginx with the script below.