01PARTCoreWebApi tutorial local demonstration environment Visual Studio2019---Vsersion:16.4.4+NetCore3.1.2 02PARTNginx quickly builds and configures load balancing Nginx is a lightweight web server/reverse proxy server and email (IMAP/POP3) proxy server released under the BSD-like protocol. Its characteristics are that it occupies less memory and has strong concurrency capabilities. In fact, nginx's concurrency capabilities perform better among web servers of the same type. Users of nginx websites in mainland China include: Baidu, JD.com, Sina, NetEase, Tencent, Taobao, etc. The following demonstrates the process of configuring Nginx 1. Download the Nginx package: http://nginx.org/en/download.html Note that the path for downloading and storing the Nginx package must be in English and cannot contain Chinese characters; 2. Start Nginx: Just double-click the downloaded Nginx package to open "nginx.exe", or you can start it through the command; the command start is not explained in detail here; after starting, open the task manager, and you will find that there will be Nginx service in the task manager; 3. At this time, you can use Nginx to configure load balancing. I first start multiple WebApi servers and run them. The data returned by the same interface of each server is slightly different. The data returned by the interface of the first server is: Chaoxi Education---1, the data returned by the interface of the second server is: Chaoxi Education---2, and the data returned by the interface of the third server is: Chaoxi Education---3. The ports of the three servers after startup are: 8011, 8022, and 8033 respectively. In other words, the 8011 port returns: Chaoxi Education---1; the 8022 port returns: Chaoxi Education---2; the 8033 port returns: Chaoxi Education---3. In other words, the three server codes are the same, but the results returned here are different, in order to be able to test the difference. 4. After startup, the debugging results are: http://127.0.0.1:8011/api/First returns: Chaoxi Education---1; http://127.0.0.1:8022/api/First returns: Chaoxi Education---2; http://127.0.0.1:8033/api/First returns: Chaoxi Education---3; Figure 1 Figure 2 Figure 3 5. The test shows that all three services have been started: At this time, I will configure three server Tonggu nginx clusters; configure the configuration files;
Modify the configuration file as follows: CMD executes the 6. Request the same address: http://127.0.0.1:8080/api/First three times and get three different results; Figure 1 Figure 2
Summarize This is the end of this article about WebApi deployment on multiple servers and Nginx load balancing configuration. For more information about WebApi deployment on multiple servers and Nginx load balancing configuration, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Detailed explanation of the use of HTML canvas and page storage technology in JavaScript
>>: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'
After MySQL is installed, you can verify whether ...
Keywords General The title cannot contain words l...
Table of contents Browser Same Origin Policy 1. V...
1. Download the installation package -Choose the ...
<br />Previous article: Web Design Tutorial ...
The task of concurrency control in a database man...
As we all know, the web pages, websites or web pag...
DOCTYPE Doctype is used to tell the browser which...
The docker repository itself is very slow, but th...
Floating elements cause their parent elements to ...
Core code <!DOCTYPE html> <html lang=&qu...
There are many Hadoop installation tutorials on L...
Table of contents 1. Proxy in LAN 2. Intranet pen...
Table of contents Pygame functions used Creating ...
ModSecurity is a powerful packet filtering tool t...