Lock screen interview questions 100 days, adhere to update the interview questions every working day. Lock screen interview questions app, small program has been launched, website address: https://www.demosoftware.cc/#/introductionPage. It has included all the contents of the interview questions updated daily, as well as features such as unlocking screen review interview questions, daily programming questions email push, etc. This will give you a head start in the interview and give the interviewer a leg up! Here are today’s interview questions:

==== How is NGINX load balancing implemented? What are the strategies? To avoid server crashes, load balancing is used to share the load on the servers. The counter server will be formed into a cluster, when the user visits, first access to a forwarding server, and then the forwarding server will distribute the access to the less pressure server. Nginx load balancing is implemented in the following five strategies: 1. Polling (the default) each request is assigned to a different backend server one by one in chronological order. If a backend server goes down, the failed system can be eliminated automatically. Upstream backserver {server; Server; The higher the value of weight is, the higher the access probability is assigned to it. It is mainly used in the case of unbalanced performance of each back-end server. The second is to set different weights in the case of master and slave, to achieve a reasonable and effective use of host resources. Upstream backserver {server =2; Server weight = 8; } 3, IP_HASH (IP binding) Each request is allocated according to the hash result of visiting IP, so that visitors from the same IP can access a backend server fixed, and can effectively solve the problem of session sharing existing in dynamic web pages. upstream backserver { ip_hash; Server; Server; } 4, FAIR (third party plugin) must install the upstream_fair module. Compared with weight and ip_hash, which are more intelligent load balancing algorithms, FAIR algorithm can intelligently load balance according to page size and load time, and give priority to those with short response time. The request is assigned to the server that responds faster. upstream backserver { server server1; server server2; fair; } url_hash(third party plugin) must install NGINX’s hash package to allocate requests according to the hash result of the URL accessed, so that each URL is directed to the same back-end server, which can further improve the efficiency of the back-end caching server. upstream backserver { server squid1:3128; server squid2:3128; hash $request_uri; hash_method crc32; }

==== How to configure high availability for Nginx (how to configure load balancing)? If the upstream server (real access server) fails or fails to respond in a timely way, it should be routed to the next server to ensure that the server’s NGINX configuration code is highly available: server {listen 80; server_name www.lijie.com; Location / {specify the upstream server load balancer proxy_pass http://backServer; Timeout between nginx and upstream server (real access server) timeout between backend server connection _ initiates handshake waiting for response timeout proxy_connect_timeout 1s; Nginx sends to upstream server (real server) timeout proxy_send_timeout 1s; Nginx accepts the upstream server (the real server) timeout proxy_read_timeout 1s; index index.html index.htm; }}

==== How can NGINX tell if another IP is not accessible? $remote_addr = if ($remote_addr = {return 403; }

==== How does Nginx restrict browser access? If ($http_user_agent ~ Chrome) {return 500; }

==== What are Rewrite global variables in NGINX? The $args variable is equal to the argument in the request line, as is the Content-Length field in the request header. Content-Type field in the $content_type request header. $document_root The value specified in the root directive for the current request. $host requests the host header field, otherwise the server name. $HTTP_USER_AGENT Client Agent Information $HTTP_COOKIE Client Cookie Information $LIMIT_RATE This variable can limit the connection rate. $request_method The action requested by the client, usually GET or POST. $remote_addr client IP address. $REMOTE_PORT port for the client. $remote_user is a user whose name has been validated by the Auth Basic Module. $request_filename The file path of the current request, generated by the root or alias directive with the URI request. $Scheme HTTP methods (e.g., HTTP, HTTPS). The protocol used for the $SERVER_PROTOCOL request, typically HTTP/1.0 or HTTP/1.1. $server_addr server address, which can be determined after a system call. $server_name Server name. $SERVER_PORT The port number at which the request arrives at the server. $request_uri contains the original URI of the request parameter and does not contain the hostname, such as “/foo/bar.php? Arg = baz “. $uri does not take the current URI of the request parameter. $uri does not contain the hostname, such as “/foo/bar.html”. $document_uri is the same as $uri.

More interview questions or learning resources can be found on my homepage or in the comments