Keystone Series II: Gateway Protocol CGI,FASTCGI,WSGI,UWSGI

Source: Internet
Author: User

A user's online process

What did the user go through when they opened the browser input URL to see the page?

1. You must first run the Web server

2. Client running browser software

3. User Input http://www.sina.com.cn/

4. The client browser handles http://www.sina.com.cn/, initiates a query for local DNS operations, and www.sina.com.cn->202.103.0.33

5. The client browser sends an HTTP request http://202.103.0.33:80/index.html (Note: 80 is the default port for the Web server, index.html is the default requested resource)

6. The server-side Web service receives the request header for the HTTP, gets the client's method from the request header, get/post.../index.html the path, and other information about the client request

7. Server-side Web service reply to Respone response header based on the information obtained

The response header contains:

Response code: 200 indicates success, 3xx indicates redirection, 4xx indicates that the client sent a request error, 5xx indicates server-side processing error occurred;

Response type: specified by Content-type;

and other relevant headers;

Usually the server's HTTP response will carry content, that is, a body, containing the content of the response, the HTML source of the Web page is in the body, compressed and returned to the client.

8. The client browser receives the data from the server, parses the HTML content after decompression, and the user sees the content of the Web page.

Other links may be nested within 9.html, such as images, videos, javascript scripts, Flash, etc., and the client browser will continue to initiate HTTP requests to get them. So the pressure from the picture and video is scattered to the various servers, a site by countless sites connected to each other, the formation of the world Wide Web, referred to as www.

In fact, it's an HTTP request-response process.

We can open the browser in the menu to choose "View", "Developer", "Developer Tools", select Network to monitor the browser and the Web server to do things.

Introduction to the two HTTP protocols

The Web server is the socket service side, the browser is the socket client, this is called B/s architecture, the standard of communication between B and S is the HTTP protocol (currently version 1.1, better than 1.0 can allow multiple HTTP requests to re-use a TCP connection)

The request headers that the Web server receives from the client

The response header that the Web server sends to the client (returns to the body is HTML)

    1. The browser sends an HTTP request;

    2. The server receives the request and generates an HTML document;

    3. The server sends the HTML document as the body of the HTTP response to the browser;

    4. The browser receives an HTTP response, removing the HTML document from the HTTP body and displaying it.

A static page and a dynamic page

Early users were accessing static pages and what were static pages? That's the same for everyone.

Keystone Series II: Gateway Protocol CGI,FASTCGI,WSGI,UWSGI

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.