This article mainly introduces the use of Nginx to deploy servers under the Windows platform, and load balancing;
1.下载nginx:http://nginx.org/en/download.html;
2. Start the nginx service:
Execute start nginx.exe instruction: as follows
3. New netCore program iis deployment, corresponding to ports 8051 and 8052 respectively;
4. Configure the Nginx.conf file as follows:
#Server cluster upstream nginxtest.com {#Server cluster name server 127.0.0.1:8051 weight = 1; #Server configuration WEIGHT means weight, the greater the weight, the greater the probability of distribution. server 127.0.0.1:8052 weight = 1; } server { listen 8050; #Listener 8050 port # server_name localhost nginxtest.com; server_name localhost; #charset koi8-r; #access_log logs / host.access.log main; location / { proxy_pass http://nginxtest.com; proxy_redirect default; }
5: Operation result:
Among them, Figure 2 is the corresponding 8051 port test procedure, Figure 3 is the corresponding 8052 test procedure;
PS: You need to pay attention to the version of netcore hosting installed locally or on the server, otherwise it may cause a 503 error