Home  >  Article  >  Backend Development  >  nginx lua install spdy

nginx lua install spdy

WBOY
WBOYOriginal
2016-08-08 09:29:591001browse

About spdy

Excerpted from http://zh.wikipedia.org/wiki/SPDY

SPDY

SPDY is an application layer protocol based on Transmission Control Protocol (TCP) developed by Google. Google first proposed the SPDY protocol in Chromium [1]. It has been used in the Google Chrome browser to access Google's SSL encryption service.
SPDY is not currently a standard protocol, but the SPDY development team has begun to promote SPDY as a formal standard (now an Internet draft). Google Chrome, Mozilla Firefox, Opera and Internet Explorer all support the SPDY protocol. The SPDY protocol is similar to HTTP, but is designed to shorten the loading time of web pages and improve security. The SPDY protocol reduces load times through compression, multiplexing, and prioritization. SPDY is not an acronym, it is simply an abbreviation for "speedy". SPDY is now a trademark of Google.

Design

The purpose of designing SPDY is to reduce the loading time of web pages. Through priority and multiplexing, SPDY only needs to establish a TCP connection to transmit web content, images and other resources. TLS encryption is widely used in SPDY, and the transmission content is compressed in gzip or DEFLATE format (unlike HTTP, the HTTP header is not compressed). In addition, in addition to passively waiting for browsers to initiate requests like HTTP web servers, SPDY web servers can also actively push content.

Relationship with HTTP

SPDY is not used to replace HTTP, it only modifies the way HTTP requests and responses are transmitted on the network; this means that only one SPDY transport layer is added, and all existing server applications can No modifications are required. When using SPDY transport, HTTP requests are processed, tokenized, and compressed. For example, each SPDY endpoint will continue to track every HTTP header that has been sent in a previous request to avoid repeatedly sending headers that have not changed. The data part of the message that has not yet been sent will be sent after being compressed.

1. Install spdy

Download the nginx+lua module.
http://openresty.org/cn/index.html

The latest version is ngx_openresty-1.7.7.2.tar.gz.
Installation command
./configure –with-http_spdy_module

2, configuration

<code>server {
    listen 443 ssl spdy;

    ssl_certificate server.crt;
    ssl_certificate_key server.key;
    ...
}</code>

is very simple.

3, test

use chrome to view

Or use spdy to test the website:

4, about spdy

If chrome or firefox supports spdy, use spdy to accelerate, otherwise use http1.1.
Reference about spdy performance optimization:
http://www.infoq.com/cn/news/2015/02/https-spdy-http2-comparison#rd
nginx+lua support for spdy:
http://wiki.nginx.org/HttpLuaModule#SPDY_Mode_Not_Fully_Supported
For complex installation, please refer to the following. Use Google's native spdy installation.
http://edge2.blogspot.com/2014/05/install-nginx-naxsi-modpagespeed-spdy.html
Another detailed introduction about spdy
http://www.geekpark.net/topics/158198

The above introduces nginx lua installation spdy, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn