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
Simple application deployment 1. Directory struct...
Sometimes we want to implement such a function: c...
Overview When a 500 or 502 error occurs during ac...
Table of contents Overview Index data structure B...
Tab bar: Click different tabs to display differen...
Abstract: When people talk about MySQL performanc...
Record the problem points of MySQL production. Bu...
With the emergence of docker, many services have ...
Preface I recently encountered this requirement a...
Table of contents 1. Download MySQL msi version 2...
Dynamically adding form items iview's dynamic...
The specific usage of the Vue image drag and drop...
There are many tools, components and programs for...
NextCloud You can share any files or folders on y...
1. Paradigm The English name of the paradigm is N...