Summarize some minor problems

Source: Internet
Author: User
Tags nginx reverse proxy

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.