A web server can build multiple web sites with independent domain names, and can also serve as a transit server on the communication path to improve transmission efficiency. 1. Implement multiple domain names with a single virtual host The HTTP/1.1 specification allows one HTTP server to host multiple web sites. Even if there is only one server physically, you can imagine having multiple servers by using the virtual host function. On the Internet, domain names are mapped to IP addresses (domain name resolution) through DNS services before accessing the target website. It can be seen that when the request is sent to the server, it is already accessed in the form of an IP address. So, if a server hosts the two domain names www.tricorder.jp and www.hackr.jp, when it receives a request, it needs to figure out which domain name to access. Under the same IP address, since a virtual host can host multiple web sites with different host names and domain names, when sending an HTTP request, the URI of the host name or domain name must be fully specified in the Host header. 2. Communication data forwarding procedures: proxy, gateway, tunnel These applications and servers can forward the request to the next server on the communication line and receive the response from that server and forward it to the client. ①Proxy : The basic behavior of a proxy server is to receive requests from clients and forward them to other servers. The proxy does not change the request URI and sends it directly to the target server that holds the resource. The server that holds the resource entity is called the origin server. The response returned from the source server is sent to the client after passing through the proxy server. Reasons for using a proxy server include: using caching technology to reduce network bandwidth traffic, controlling access to specific websites within an organization, and obtaining access logs as the main purpose, etc. There are several ways to use proxies: Caching Proxy : When a proxy forwards a response, the caching proxy saves a copy of the resource on the proxy server in advance. When the proxy receives a request for the same resource again, it can return the previously cached resource as a response instead of obtaining the resource from the origin server. Transparent Proxy : A proxy type that does not perform any processing on messages when forwarding requests or responses is called a transparent proxy. On the contrary, a proxy that processes the message content is called a non-transparent proxy. ②Gateway : The working mechanism of gateway is very similar to that of proxy. The gateway enables the server on the communication line to provide non-HTTP protocol services. Using a gateway can provide communication security because encryption can be used on the communication line between the client and the gateway to ensure the security of the connection. ③ Tunnel : The tunnel can establish a communication line with other servers as required, and then use encryption methods such as SSL for communication. The purpose of the tunnel is to ensure that the client can communicate securely with the server. The tunnel itself does not parse HTTP requests. In other words, the request is forwarded to the subsequent server as is. The tunnel ends when both communicating parties disconnect. 3. Cache for saving resources A cache is a copy of a resource stored on a proxy server or client's local disk. Using cache can reduce the access to the server, thus saving communication traffic and communication time. A cache server is a type of proxy server and is classified under the caching proxy type. ①Cache validity period ②Client cache |
<<: Two ways to declare private variables in JavaScript
>>: Install mysql5.7.17 using RPM under Linux
There are many tags in XHTML, but only a few are ...
Table of contents Results at a Glance Heart Effec...
Contemporary web visual design has gone through th...
It’s great to use CSS to realize various graphics...
Given a div with the following background image: ...
Product designers face complex and large manufactu...
This article describes how to boot the Linux syst...
Every visit will generate Cookie in the browser, ...
HTML to achieve simple ListViews effect Result: c...
There are three main ways of MySQL replication: S...
Preface A few days ago, I came across the feature...
1. Application Scenarios Parent page a.jsp Subpage...
1. Set up HOST on the host Macbook The previous d...
Background of the accident: A few days ago, due t...
Port Mapping Before the Docker container is start...