Nginx Study Notes-Server Load balancer and reverse proxy

Source: Internet
Author: User
Tags nginx reverse proxy


1. Proxy and reverse proxy server: connection requests from the proxy internal network to the Internet. External access requests to the internal network are not supported. Reverse Proxy Server: acts as a proxy for hosts on the external network to access the internal network. Www.2cto.com 2. Common WEB Server Load balancer methods (1) manually select the server from which the user chooses to download resources from which the user downloads resources. (2) add multiple A records to the same host name in DNS round-robin mode so that the DNS can poll multiple IP addresses and view the domain name resolution using the dig command in Linux: dig xxx. baidu. disadvantages of comDNS round-robin: www.2cto.com. low reliability B. load Distribution is not balanced, so DNS round robin is suitable for load balancing with low reliability requirements, such as slice Server Clusters and pure static Web Server clusters. (3) layer-4/layer-7 Server Load balancer usually works with layer-4 or layer-7 OSI of OSI: Open System Interconnection) layer-7 data format functions and Connection Methods an interface gateway Presentation layer Presentation data representation, data security, and data compression between the Application network of a typical device and the user Application terminate a session Transport layer the Transport data is organized into a Data Segment. An addressing mechanism is used to identify a specific application (port number) firewall Network layer Network segmentation and re-combination of packets Packet based on Network layer address (IP address) select the path between different network systems. Router Data Link layer Data Link encapsulates the bit information into a Data Frame to establish, cancel, identify the Logical Link, reuse the Link, and check errors on the physical layer. Uses the hardware address or Physical address of the receiving system to address the construction, maintenance, and cancellation of Physical connection optical fiber, coaxial cable, and,
Twisted Pair wires, reconnections, and hubs 3. multi-line multi-region smart DNS resolution and hybrid Load Balancing 4. after Nginx reverse proxy configuration uses reverse proxy, the backend WEB Server (taking PHP as an example ), you cannot directly use the $ _ SERVER ['remote _ ADDR '] variable to obtain the real IP address of the user. In this case, the IP address of the Nginx SERVER Load balancer is obtained. In this case, you need to add the Header information X-Forwarded-For in the Nginx reverse proxy so that the backend SERVER can get the user's real IP address through $ _ SERVER ['HTTP-X-FORWORDED-FOR. Refer to the commonly used functions for getting user IP addresses. 5. dynamic and Static web page separation Citrix NetScaler layer-4 Server Load balancer (TCP-based) Nginx Server Load balancer architecture 6. key Upstream module Upstream: The main module of Nginx Server Load balancer, which is located within http. The default server Load balancer mode is polling. Ip_hash: In Server Load balancer, requests from a client IP address are located on the same backend server using the hash algorithm to avoid session sharing. If you can share a session with www.2cto.com, do not use this configuration because it may cause load imbalance. To remove the server Load balancer server, you need to set it down instead of deleting the record. Deleting the record may result in session failure (the original back1hash goes up to back2) upstream backend {ip_hash; server back1.10jqka.com.cn; server back3.10jqka.com.cn down;} server Syntax: server name [parameters] default nonename can be domain name, IP address, port number, UNIX Socketparameters can be www.2cto.com 7. server Load balancer supports two high availability methods: (1) one master server and one hot backup server (2) Two Server Load balancer instances
 

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.