Squid Reverse proxy)

Source: Internet
Author: User
Tags internet cache nslookup tool squid proxy

Squid Reverse proxy)
Reverse Proxy also provides cache acceleration, but the service object is reversed.
Traditional and transparent proxies mostly provide cache proxies for LAN users to access web sites on the Internet;
Reverse Proxy, on the contrary, provides cache acceleration for internet users to access web sites in the enterprise lan. It is a reverse proxy process and is called reverse proxy.
For some websites with a large access volume (such as Sina and Sohu), providing reverse proxy can play a good role in acceleration and greatly relieve the pressure on web servers, such: use the nslookup tool to parse the IP address corresponding to the www.bkjia.com site (there are usually multiple IP addresses, which are based on the dns Introduction)
If you select one of them to access the service directly in the browser, squid will find the error message returned by the proxy service. When you use www.bkjia.com to access the service, you will not feel the existence of the squid service.
Traditional and transparent proxies provide services for LAN users. They provide cache acceleration for websites accessing the internet, but the access targets are not fixed;
Reverse Proxy mainly provides services for internet customers. It provides cache acceleration for websites that access enterprises. The access targets are relatively fixed.
Using squid reverse proxy, websites that actually provide web Services in the background can be located on the internet or within the enterprise lan. There can be one or more web Service-provided hosts.
In squid. in the conf file, there are two basic options for implementing the reverse proxy service: Add "vhost" after http_port (Note: vhost and transparent cannot be used at the same time) use the cache_peer configuration item to specify the IP address and port of the host (sometimes called an upstream server) that actually provides web Services in the background.
Format:
Add support for reverse proxy and listen to the service on port 80 of the Public IP Address
Vi/etc/squid. conf
Http_port 219.16.21.100: 80 vhost
Specify the web server host location
Cache_peer web server address server type http port icp port [Optional]
Web server address: not explained
Server Type: it corresponds to the cache level of the target host. The upstream web host generally uses "parent"
Http port: the web server's web Service port, such as port 80 and port 8080. It is used to connect to an adjacent icp (internet cache protocol) cache Server (usually another squid host ), if not, use 0. Optional: some additional plug-in parameters when the cache is provided. For example, "originserver" indicates that the server is the original host that provides web Services, "weight = n" indicates the priority weight of the server. n is an integer. A greater number indicates a higher priority (1 by default ); "max-conn = n" specifies the maximum number of connections from the proxy host to the web server.

Environment Description:
The company uses four web servers for load balancing and uses squid for proxy acceleration at the front end. internet users directly serve squid reverse proxy servers (Public ip addresses and dns (cdn) through the squid proxy server.

Steps:
1. Modify the squid. conf configuration file.
Http_port 80 vhost
Cache_peer 192.168.1.11 parent 80 0 originserver weight = 5 max-
Conn = 30
Cache_peer 192.168.1.12 parent 80 0 originserver weight = 4 max-
Conn = 15
Cache_peer 192.168.1.13 parent 80 0 originserver weight = 4 max-
Conn = 10
Cache_peer 192.168.1.15 parent 80 0 originserver weight = 1 max-
Conn = 8
/Etc/init. d/squid restart
Netstat-utpln | grep 80

2. Access the client on the internet. Use the IP address of the reverse proxy server.
And view the agent log,
Tail-f/var/log/squid/access. log

Squid details: click here
Squid: click here

Recommended reading:

Configure Squid proxy http and rsync

Squid: high-speed Web Access

CentOS 6.2 compilation and installation Squid configuration Reverse Proxy Server

Application of Squid in Enterprise Network

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.