Differences between ip_hash and url_hash in nginx

Source: Internet
Author: User
: This article mainly introduces the differences between ip_hash and url_hash in nginx. For more information about PHP tutorials, see. I recently looked at nginx server load balancer and found that there are two ways to solve the nginx session problem: ip_hash and url_hash. ip_hash maintain the session based on the ip address, url_hash is based on the url address. the advantage of url_hash is that it can improve the efficiency of the backend cache server, such as improving the squid efficiency. However, when the backend server goes down, url_hash does not automatically jump to other cache servers, but returns a 503 error to the user. what I want to ask is whether ip_hash solves this problem and will jump to other servers, in the same way, a 503 error will be returned. what is the difference between ip_hash and url_hash? can nginx solve the session problem and solve the backend server health check problem. I remember squid can be used for health check and session persistence.

Or you can use memcached to maintain the session and share the session without worrying about session disconnection.

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

The above introduces the differences between ip_hash and url_hash in nginx, including some content, and hope to help friends who are interested in PHP tutorials.

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.