Separation of static and dynamic Dynamic requests and static requests are separated through middleware to reduce unnecessary request consumption. Advantages: Dynamic and static services do not affect each other. If the dynamic service is stopped, static resources can still be accessed normally. Examples Simulation environment: lb01, web01 (simulation static server), web02 (simulation dynamic server) 1. Create a directory /pm_code/images/ on web01 and upload a picture Configure the nginx file /etc/nginx/conf.d/static.conf: 2. Install tomcat on web02
The default port of tomcat is 8080. Confirm that it is opened normally: mkdir /usr/share/tomcat/webapps/ROOT Create a file random.jsp in this directory with the following content: 3. Create the configuration file ds.conf in /etc/nginx/conf.d/ on lb01 with the following content Create /pm_code/ds/index.html with the following content: 5. Add in the local hosts file of the physical host: 192.168.1.5 ds.pm.com 6. Testing Close the nginx service on web01 and refresh the page (use shift+F5 to force refresh and reconnect to prevent caching) Open the nginx service of web01, close the tomcat service of web02, and refresh the page The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Summary of Vue3 combined with TypeScript project development practice
>>: Solution to the problem of MySQL data delay jump
I believe that the Internet has become an increas...
Table of contents Identifier length limit Length ...
Here 123WORDPRESS.COM presents the first part of ...
Preface Relational databases are more likely to b...
In fact, many companies have functions similar to...
Preface As a heavy user of front-end frameworks, ...
1. The effect diagram implemented in this article...
This article example shares the implementation of...
Table of contents Method 1: set: It is not a data...
You can use the ps command. It can display releva...
This article mainly introduces the sample code of...
This article example shares the specific code of ...
The previous article was a simple review of the B...
Recently, when I was drawing an interface, I enco...
Prerequisite: Mac, zsh installed, mysql downloade...