Graphic HTTP notes (five) - Web Server

The main content of this chapter is to explain the collaboration with the HTTP Web server

First, to achieve a single virtual host multiple domain names

Based Virtual Host feature, you can use the site to deploy only a single physical machine to implement multiple domain names.

On the Internet, domain names can be mapped by DNS domain name resolution system to specific IP, multiple domain names can be mapped to the same IP, but a domain name can be mapped to a IP. If you want to know the server domain name from which the request may be obtained by request header Host header field.

Second, proxies, gateways and tunnels

When HTTP traffic, except for the service and client, there are some for communication data transfer processing of applications , such as proxies, gateways and tunnels, they can work with the server.

  • Acting is a kind of application forwarding function, the role played by the server and client intermediaries. Agent accepts client requests to the server, and then forwards the response from the server to the receiving client.
  • Gateway when the server is forwarding data to other server communication, receiving requests from the client, and it's like they own resources as the source server to process the request.
  • The tunnel is in transit between the client and server are far apart and remain connected to both applications.

2.1 Proxy

webproxy

The basic behavior of the proxy server is between the client and server to forward requests and responses, agents do not change request URI, it will be sent directly to the server that holds the resource (called the source server ).

multihttpproxy

Each time through a proxy or in response to forward the request, additional writing will Via header field, the proxy host information fields passing mark.

The reason for using a proxy server include the use of caching technology to reduce network bandwidth traffic, access to specific sites within the organization for control, gain access logs.

Agents can use follow whether to use cache and whether to modify packets to classify.

Caching proxy : proxy forwards a response, will save resources on the proxy server, when the agent again receive the same resource request, will return the cached before resources.

Transparent proxy : forwarding the request or response packet does not make any modifications of the type called transparent proxy agents, otherwise known as non-transparent proxy.

Gateway 2.2

httpgateway

Gateways and agents working mechanism is very similar, but the gateway server can make on a communication line to provide non-HTTP protocol services.

Using the gateway communication security can be improved, as can the encryption on the communication line between the client and the gateway to ensure the security of the connection.

2.4 Tunnel

Tunnels can establish a communication line with other servers, then using SSL encryption and other means of communication as required. The purpose of the tunnel is to ensure that the client and server can communicate securely .

Third, save the resource cache

Cache refers to a copy of the resource stored in the proxy server or the client's local disk.

Using the cache can reduce access to the source server, the traffic can be reduced and a communication time.

Cache server is a proxy server, and classified in the cache proxy type.

3.1 Cache expiration date

Even if there is a cache, also because of the requirements of the client, the cached resource is valid and other factors confirm the validity of the source server. If a cache miss, the cache server will get the "new" resources to the source server again.

httpcache

3.2 client cache

In addition to the cache in the proxy server, the client browser may also cache. The same client also determine the effectiveness of resources to the source server, and then return a valid resource.

Guess you like

Origin www.cnblogs.com/DM428/p/11203712.html