CẤU HÌNH NGINX LÀM RESERVE PROXY TRÊN CENTOS
1. Sẵn sàng cài đặt
Webserver: sẵn sàng một trang bị chủ thiết đặt OS Centos 7.6.1810 có địa chỉ IP public 10.10.11.165Máy Client: chuẩn bị một sản phẩm client setup OS Win 10 nhằm kiểm tra truy vấn website với IP client 10.10.11.160

2. Cài đặt Nginx
Các chúng ta có thể tham khảo nội dung bài viết hướng dẫn thiết lập nginx trên đây
3. Thiết lập Apache
Chúng ta áp dụng lệnh yum để thiết lập apache
Bạn đang xem: Cấu hình nginx làm reserve proxy trên centos
4. Cấu hình Nginx reverse proxy mang đến apache
4.1 mong hình Nginx
Chúng ta sẽ biến hóa cấu hình của file nginx.conf như saucd /etc/nginx/cat >> nginx.conf EOFworker_processes 4;pid /var/run/nginx.pid; events worker_connections 768; http sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; gzip on; gzip_disable "msie6"; gzip_min_length 1100; gzip_buffers 4 32k; gzip_types text/plain application/x-javascript text/xml text/css; open_file_cache max=10000 inactive=10m; open_file_cache_valid 2m; open_file_cache_min_uses 1; open_file_cache_errors on; ignore_invalid_headers on; client_max_body_size 8m; client_header_timeout 3m; client_body_timeout 3m; send_timeout 3m; connection_pool_size 256; client_header_buffer_size 4k; large_client_header_buffers 4 32k; request_pool_size 4k; output_buffers 4 32k; postpone_output 1460; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*;EOF
Xem thêm: Làm Cách Nào Để Đặt Khoảng Cách Dòng Trong Html, Các Thuộc Tính Định Dạng Cho Text
Tạo tệp tin Vhost mang lại nginx, file cấu hình của vhost sẽ tiến hành lưu trong đường truyền /etc/nginx/conf.d/ với /etc/nginx/sites-enabled/Trong bài viết này thực hiện domain quyenbx.name.vn bắt buộc file config sẽ tiến hành tạo với thương hiệu quyenbx.name.vn.conf để minh bạch với những vhost bao gồm domain không giống nhau.File Vhost sẽ sở hữu nội dung như bên dưới
cd /etc/nginx/conf.d/cat >> quyenbx.name.vn.conf EOFserver pngEOF