Article Title: Several background WEB Implementation Instructions for Squid reverse proxy. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
1. Squid reverse proxy for a single backend WEB Server
A. If the WEB server and reverse proxy server are two separate machines (generally, reverse proxy should have two NICs connected to the internal and external networks respectively ). Modify the following content to set the reverse proxy service.
Http_port 80 # squid listening port
Httpd_accel_host 192.168.0.100 # IP address of the internal WEB Server
Httpd_accel_port 80 # IP address of the WEB server
Httpd_accel_single_host on # forward the request as a buffer to a separate Machine
Httpd_accel_with_proxy on #
Httpd_accel_uses_host_header off
B. If the WEB server and reverse proxy server are the same machine. Therefore, the WEB server listening port should be set to a non-80 port (for example, port 81 ). The content to be modified is as follows:
Http_port 80 # squid listening port
Httpd_accel_host localhost # IP address of the internal WEB Server
Httpd_accel_port 81 # IP address of the WEB server
Httpd_accel_single_host on # forward the request as a buffer to a separate Machine
Httpd_accel_with_proxy on #
Httpd_accel_uses_host_header off
The following describes the configuration commands:
Http_port 80
The http_port option specifies the port for the squid to listen to the HTTP request. Generally, it is set to port 80, so that the user does not feel the existence of the reverse proxy, just like accessing the Real WEB server.
Httpd_accel_host 192.168.0.100 and httpd_accel_port 80
The httpd_accel_host and httpd_accel_port options specify the IP address and port number of the WEB server, depending on the actual situation of your WEB server.
Httpd_accel_single_host on
When httpd_accel_single_host is on, squid is set to reverse proxy only for a single web server. Without considering the HTTP header information, Squid forwards all buffered page requests to this web server. If squid requires multiple reverse proxies for web servers, you must set this option to off and map requests to the appropriate backend WEB server using steering gear or DNS.
Httpd_accel_with_proxy on
If you want squid to act as both the reverse proxy server and the Internet proxy for the local machine, you need to change httpd_accel_with_proxy to on, which is off by default.
Httpd_accel_uses_host_header off
In HTTP 1.1, an HTTP request includes a Host Header, specifying the Host Name of the URL or the IP address of the host. This option can be used to complete the reverse proxy function of multiple backend WEB servers.
[1] [2] Next page