Nginx là gì?
Nginx là một webserver, có thể dùng làm proxy ngược mã nguồn mở (open source reverse proxy server) sử dụng phổ biến giao thức HTTP, HTTPS, SMTP, POP3 và IMAP , cũng như dùng làm cân bằng tải (load balancer), HTTP cache và máy chủ web (web server).
Cài đặt và cấu hình Nginx trên Centos 7
1. Add repo
rpm -Uvh You are not allowed to view links.
Register or
Loginrpm -Uvh You are not allowed to view links.
Register or
Loginrpm -Uvh You are not allowed to view links.
Register or
Login rpm -Uvh You are not allowed to view links.
Register or
Loginrpm -Uvh You are not allowed to view links.
Register or
Loginrpm -Uvh You are not allowed to view links.
Register or
Login2. Cài đặt Nginx
yum -y install nginx
yum -y install nginx
3. Cấu hình
Mở file /etc/nginx/nginx.conf
– Tìm
worker_processes 1;
Sửa thành
worker_processes 2;
– Tìm
#gzip on;
Sửa thành
gzip on;
– Mở file /etc/nginx/conf.d/default.conf
tìm: server_name You are not allowed to view links.
Register or
Login và sửa You are not allowed to view links.
Register or
Login thành domain của bạn
– Khởi động Nginx: Chạy lần lượt các lệnh sau
systemctl stop httpd
systemctl disable httpd
systemctl start nginx
systemctl enable nginx
systemctl stop httpd
systemctl disable httpd
systemctl start nginx
systemctl enable nginx
– Test: You are not allowed to view links.
Register or
Login