I've been busy for half a month. All kinds of pressure, side of the development side of the Test side of the three-side project, while dealing with issues and development issues, people are divided into several. Today, we summarize the problems encountered and solutions.
Deployment Environment Nginx Tomcat
1.www.xxx.com/app/Remove the app name app, we access it directly in the development environment in www.xxx.com/app/way, but in the production environment we need to remove the app/
Workaround: Open the Server.xml file under the Tomcat Conf folder and add <context path= "" docbase= "/app" debug= "0" reloadable= "true" under the host node/>
2. Using the Nginx reverse proxy for Tomcat load balancing will cause Tomcat's session to not be shared. Based on this problem we shut down a tomcat and later will use Redis instead of session.
What is the difference between 3.Http (from cache) and 304 (not modified)?
Phenomenon: When we visit the page, we find that the data is always wrong and must be refreshed before it can be displayed properly, the initial estimate is the cache problem. But each page is the same situation, is no longer a simple browser cache problem.
Later find causes found. Although each HTTP response is 200, it is found that each request reads the cached from cache.
So Baidu a bit of the difference between 200 and 304: https://www.bokeyy.com/post/200-ok-from-cache-vs-304-not-modified.html
The "from cache" is a browser that does not confirm with the server and uses the browser cache directly, whereas 304 not Modified is the cache that the browser and server confirm the cache validity and reuse.
After understanding the principle, it may be that there is a problem with nginx configuration,
After you kill expires, you can access it normally.
4. When we were testing, we found that some of the data ran to the test library. Find the reason found that the domain name of the intranet map to the production IP and the public domain name is not synchronized or mapped to the test IP. If you find this situation, ping the IP address of the domain name directly.
This is also the cause of some strange problems.
Summarize some minor problems