Configuration not saved to nginx.conf

asterix23

Verified User
Joined
Nov 10, 2019
Messages
6
Hello,

I have a website with heavy traffic hosted on a dedicated server with 12 cpu Core

I did try to optimize Nginx conf to handle the traffic, but my modifications are not saved.

I made the changes to nginx.conf file in /usr/local/directadmin/custombuild/configure/nginx/conf/

Code:
worker_processes  auto;
events {
    worker_connections 6144;
    multi_accept on;
}

access_log off;

When I check with this command : ulimit -n
I see 1024, not 6144

Is that normal?

I did also edit nginx-defaults.conf in etc/nginx/ but same result.


Thank you for you help.
 
you need to copy your any want to custom file to /custom like
/usr/local/directadmin/custombuild/custom/nginx/conf/nginx.conf


when you want to set ulimit should use worker_rlimit_nofile
LIKE
Code:
worker_processes        auto;
worker_rlimit_nofile    65535;
and use command

Code:
cd /usr/local/directadmin/custombuild
./build rewrite_confs
 
I don't have custom folder inside /usr/local/directadmin/custombuild/

Should I create one manually??

Thank you!!
 
I basically do it with UI interface in Server Manager > Custom HTTPD Configurations > nginx.conf as Admin privilage
After i add the modifications, i just click ./build rewrite_confs button
And Nginx work correctly with modifications change ...
 
This will work with multiple domains? or I should do it for each domain on the server?

Thanks!
 
I basically do it with UI interface in Server Manager > Custom HTTPD Configurations > nginx.conf as Admin privilage
After i add the modifications, i just click ./build rewrite_confs button
And Nginx work correctly with modifications change ...
This will work for different domain, each domain has different nginx.conf file
 
i have a some problem !
my nginx.conf file in address:
/usr/local/directadmin/custombuild/configure/nginx/conf/nginx.conf
this:
Code:
worker_processes  6;

pid /var/run/nginx.pid;

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

events {
   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;
}

after add after event this:
Code:
events {
    worker_connections  1024;
client_body_buffer_size 10K;
client_header_buffer_size 1k;
client_max_body_size 8m;
large_client_header_buffers 2 1k;
    include /etc/nginx/nginx-events.conf;
}

and restart nginx ...
got a problem for start nginx!!
 
Code:
client_body_buffer_size 10K;
client_header_buffer_size 1k;
client_max_body_size 8m;

should at in
nginx-events.conf
 
Last edited:
Code:
client_body_buffer_size 10K;
client_header_buffer_size 1k;
client_max_body_size 8m;

should at in
nginx-events.conf
But after run
./build rewrite_confs
new config is gone!!
how dissolved this problem?
 
Back
Top