Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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

  1. Create nginx directory(Path: /home/ec2-user/nginx)

    1. mkdir nginx && chmod 775 -R nginx

  2. Create nginx.conf file (Path: /home/ec2-user/nginx/nginx.conf)

    1. vi nginx.conf

  3. press i to insert information

  4. Attache below information

  5. press esc to exit edit

  6. write :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;
}

  • No labels