Hướng dẫn cấu hình Reverse Proxy với Nginx
Đơn giản nhất là bạn cd /etc/nginx/conf.d
Tạo 1 file đặt tên domain bạn muốn làm reverse rồi đưa nội dung sau vào
Trường họp không có SSL thì bạn bỏ đoạn cấu hình ssl ra
Bạn muốn chuyển qua iP or port nào phía sau thì bạn thêm chỉnh ở dòng bypass
vi test.quantrinet.com.conf
==============
server {
listen 80;
server_name test.quantrinet.com;
# Log files
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
location / {
include /etc/nginx/ngx_proxy_params.conf;
proxy_pass
http://192.168.101.73:80;
}
}
server {
listen 443 ssl;
server_name test.quantrinet.com
www.test.quantrinet.com;
ssl_certificate /etc/nginx/ssl/quantrinet.com.crt;
ssl_certificate_key /etc/nginx/ssl/Private.key;
location / {
include /etc/nginx/ngx_proxy_params.conf;
proxy_pass
http://192.168.101.73:80;
}
}
=========================
Chúc bạn thành công