: 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.