preface
A server can build multiple independent domain name web sites, and can also be used as a transfer server on the communication path to improve transmission efficiency
Virtual host
The HTTP/1.1 specification allows a single HTTP server to host multiple Web sites. Providers of web hosting services, for example, can serve multiple clients with a single server or run different websites under the domain names held by each client. The function of virtual host is used here. Even though there is only one server in the physical layer, as long as the virtual host function is used, you can imagine that you have multiple servers.
At the same IP address, the virtual Host can Host multiple web sites with different Host names and domain names. Therefore, when sending HTTP requests, the Host header must specify the URI of the Host name or domain name.
Communication forwarding programs – agents, gateways, and tunnels
Concept of the three
- The agent. A forwarding application that acts as a “middleman” between the server and the client, receiving requests from the client and forwarding them to the server, and receiving responses from the server and forwarding them to the client
- A gateway is a server that forwards communication data from other servers. When receiving a request from a client, it processes the request as if it were a source server that owns its own resources.
- The tunnel. A tunnel is an application that communicates between a remote server and a remote client.
What’s the use of an agent?
- Use caching technology to reduce network bandwidth traffic
- Access control within the organization to specific networks (e.g., some companies restrict access to certain websites)
- For the purpose of obtaining access logs (you can record some information in the middle, via header fields, etc.)
How to be an agent?
- Caching proxy. When forwarding a response, the caching proxy prestores a copy of the resource on the proxy server. When the server is requested again, resources can be fetched directly from the proxy server
- Transparent proxy. Transparent Proxy Is a type of Proxy that forwards requests or responses without processing the packets.
Why use a gateway
- The gateway enables servers on communication lines to provide non-HTTP services.
- Using gateways improves the security of communication because the communication line between the client and the gateway can be encrypted to secure the connection.
Why use tunnels
- Ensure that the client can securely communicate with the server. The tunnel does not parse the HTTP request, that is, the request is forwarded to the subsequent server as is.
Save a cache of resources
The concept of cache The cache is a copy of resources stored on the local disk of the proxy server or client. Caching reduces access to the source server, thus saving traffic and communication time.
Client caches can exist not only in the cache server, but also in the client browser. In the case of Internet Explorer, client caches are called temporary network files.
If the browser cache is valid, it does not need to send requests to the server for the same resource and can be read from the local disk.