Skip to content

LinMax-Dev/nginx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Nginx project

References

System Requiremnets

  • 3x Virtual machine running Centos
  • 2 GB of RAM
  • 2 CPU cores

purpose

  • NGINX can save both static and dynamic content . it's a highly optimized for delivering static files like HTML , CSS and images very quickly .
  • it acts an intermediary between client requets and backend servers , offering features like caching , compression and security
  • NGINX can distribute incoming requests across multiple servers, balancing the load to improve availabilty and reliability and handling spikes efficiency . Nginx based on event driven and asynchronous

Steps

  • Install the EPEL repositort and NGINX package

    dnf install epel-release -y
    
    dnf install nginx -y
  • After instalation , you will manage NGINX using the systemd ervice manager

    systemctl start nginx | systemctl enable nginx 
    
  • Open firewall for http and https protocols

    firewall-cmd --permanent --add-service=http |
    firewall-cmd --permanent --add-service=https
    firewall-cmd --reload 
  • Security-Enhanced Linux (SELinux) provides and additional security layer

    setsebool -P httpd_can_network_connect 1 | getsebool httpd_can_network_connect

Configuration files

Main context : Global setting like worker processes. Events context : Handles connection processing. HTTP context: Configures HTTP serer behavior. Server context: Defines settings for virtual hosts (server blocks). Location context : specifies how to process requests for specific locatios or URLs. Main Context file Main Configuration

Max_clients = worker_processes ✖️ worker_connections

Configuring Error and Access logging Access logs

/var/log/nginx/access.log main; 

Error logs

/var/log/nginx/error.log warn; 

Document Root and Permissions : NGINX involves defining the document root , which is the directory where website files like index.html are stored server Dont forget to change the root

sudo chown -R nginx:nginx /var/www/html
  • make custom error page error_page

  • managing Virtual hosts multiple of websites multiple_websites

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published