nginx: configuration file test failed

3245

Verified User
Joined
Mar 28, 2013
Messages
34
Hello,

I using DirectAdmin and Nginx installed, i have huge clients at the moment and i see "Nginx 503 Error" sometimes, and i have 3Gb ram with 790 used ram...

And now i want increase Worker Connections, but in this File i have no this item:

nano /etc/nginx/nginx.conf

and when i add this item manually, i see below error after Nginx restart:

[root@server ~]# service nginx restart
nginx: [emerg] "worker_connections" directive is duplicate in /etc/nginx/nginx-events.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed

also when i increase "worker_processes 1;" to 5, after restart nginx it see still 1 with below output:
[root@server ~]# grep processor /proc/cpuinfo | wc -l
1

below is my output of configuration file:

#user nginx;

# The number of worker processes is changed automatically by CustomBuild, according to the number of CPU cores, if it's set to "1"
worker_processes 100;

pid /var/run/nginx.pid;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

events {
# worker_connections 1024;
include /etc/nginx/nginx-events.conf;
}


http {
include /etc/nginx/mime.types;

# For user configurations not maintained by DirectAdmin. Empty by default.
include /etc/nginx/nginx-includes.conf;

# Supplemental configuration
include /etc/nginx/nginx-modsecurity-enable.conf;
include /etc/nginx/nginx-defaults.conf;
include /etc/nginx/nginx-gzip.conf;
include /etc/nginx/directadmin-ips.conf;
include /etc/nginx/directadmin-settings.conf;
include /etc/nginx/nginx-vhosts.conf;
include /etc/nginx/directadmin-vhosts.conf;
}

Thanks for help.
 
Hello,

You should carefully learn a structure of config files in /etc/nginx/ and find a correct file to modify. Then do not change anything in /etc/nginx/ as you will loose your customization, modify instead files in /usr/local/directadmin/custombuild/custom/nginx/conf/

P.S. The forums already have similar threads so you might consider searching the forums before posting.
 
Back
Top