Xiaobai sincerely asks for advice
The picture above is the configuration file of Nginx
If you write this in index.jsp: <img src="img/test.png" >
This is the implementation Is load balancing done?
If not, how should I configure it?
When this img/test.png image is loaded in the browser, is it looking for resources in tomcat or Nginx cached resources? ?
First of all, with this configuration, you only realize that the image resources are processed directly by nginx.
But, but, but, what about ajax requests? What about front-end js, css and .ttf? Do you still want to write?
I am usually the first one
Then one more rule above this
In this way, except for requests starting with /resources, the rest will be transferred to the tomcat instance behind for processing.
Randomly written chestnuts, a search on the Internet, there are too many explanations on various configurations.
Dynamic and static separation means that the application server such as tomcat handles dynamic requests, and nginx handles static requests. You can stop tomcat to test whether nginx is working. This has nothing to do with load balancing, right?