I wanted to try to set the worker processes in nginx, but it throws me this error:
nginx: [emerg] "worker_processes" directive is not allowed here in /etc/nginx/sites-enabled/default:1
nginx: configuration file /etc/nginx/nginx.conf test failed
here is my code
worker_processes 4;
worker_rlimit_nofile 8192;
worker_priority 0;
worker_cpu_affinity
0001 0010 0100 1000;
server {
server_name --.--.--.---;
listen 80;
#root /var/www/devsites/wordpress/;
root /var/www/devsites/trademob/tm-hp-v2/;
What can I do to fix this issue?
Best Answer
You said that your error message was:
Place this directive at the top of
/etc/nginx/nginx.conf
instead of in/etc/nginx/sites-enabled/default
. Theworker_processes
directive is valid only at the top level of the configuration.The same applies to all the other
worker_*
directives you've used.