Nginx For Windows HTTP轉發和負載

Nginx For Windows HTTP轉發和負載

一、需求說明

使用Nginx進行端口轉發,並且負載到兩臺服務器的服務上。

監控本地服務器的 9099 端口,轉發並負載到 127.0.0.1:9001127.0.0.1:9002 服務上。(可以選擇只轉發到一個端口的服務,不負載)

二、配置文件

完整配置文件如下,測試可用


#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024000;
}


http {
    upstream test_site {
        server 127.0.0.1:9001;
        server 127.0.0.1:9002;
    }
    server {
        listen 9099;
        server_name localhost;
        location / {
            proxy_pass http://test_site;
        }
    }
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章