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
Table of contents Preface analyze Initial Renderi...
Just as the title says. The question is very stran...
Preface I believe that the syntax of MySQL is not...
1. Monitoring planning Before creating a monitori...
1. Preparation After installing the Linux operati...
Docker version 1.13.1 Problem Process A MySQL con...
1. To download the MySQL database, visit the offi...
1. Add a hard disk 2. Check the partition status:...
1. Set CORS response header to achieve cross-doma...
This article shares the specific code of Vue to i...
Preface The explain command is the primary way to...
The MySQL database does not have an incremental b...
In the MySQL database, null is a common situation...
Physically speaking, an InnoDB table consists of ...
The value of the background property in CSS backg...