Overview
/etc/nginx/nginx.conf
The main Nginx configuration file is located at /etc/nginx/nginx.conf
. This is where you can change settings like the user that runs the Nginx daemon processes, and the number of worker processes that get spawned when Nginx is running, among other things.
Create nginx.conf
Location
Linux: /etc/nginx/nginx.conf
AWS: /home/ec2-user/nginx/nginx.conf
Process
Create nginx directory(Path: /home/ec2-user/nginx)
mkdir nginx && chmod 775 -R nginx
Create nginx.conf file (Path: /home/ec2-user/nginx/nginx.conf)
vi nginx.conf
press
i
to insert informationAttache below information
press
esc
to exit editwrite
:wq
to sava and exit
Optimization
AWS t2.large spec: CPU 2 core, RAM 8 GB
CPU: Dual-core
worker_processes 2;
Ram up to 8GB
worker_rlimit_nofile 8192;
worker_priority: Range: -10 ~ 20
worker_priority 0;
Simultaneous connection
events { multi_accept off; worker_connections 1024; }