Skip to content

chenzhaoyu/http2-push-nginx-module

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

http2-push-nginx-module

https://travis-ci.org/ghedo/http2-push-nginx-module.png

http2-push-nginx-module is an experimental and extremely unstable NGINX module that implements HTTP/2 server push.

The module can be used by either specifying what resources to push statically in the NGINX config file (see static example) or by leveraging OpenResty and Lua's FFI support (see openresty example).

Configuration

http2_server_push

syntax: http2_server_push on | off

default: http2_server_push off

context: http, server

Specifies whether to enable HTTP/2 server push.

http2_push_path

syntax: http2_push_path <url>

context: http, server, location

Specifies a resource that should be pushed.

http2_max_pushed_streams

syntax: http2_max_pushed_streams <number>

default: http2_max_pushed_streams 100

context: http, server

Specifies the maximum number of resources that will be pushed on a connection.

Building

http2-push-nginx-module is distributed as source code. Build with:

# download and unpack NGINX sources
$ wget 'http://nginx.org/download/nginx-1.12.2.tar.gz'
$ tar -xzvf nginx-1.12.2.tar.gz
$ cd nginx-1.12.2/

# apply required patch to NGINX
$ patch -p01 < /path/to/http2-push-nginx-module/patches/nginx_1.12.2_http2_server_push.patch

# configure and build NGINX
$ ./configure --prefix=/opt/nginx \
      --with-http_ssl_module \
      --with-http_v2_module \
      --add-module=/path/to/http2-push-nginx-module
$ make

TODO

  • Honour MAX_CONCURRENT_STREAMS setting from clients
  • Write tests (basic, 304 response, CONTINUATION, ...)
  • Write example to parse Link headers (in Lua)

Copyright

Copyright (C) 2017 Alessandro Ghedini <alessandro@ghedini.me>

See COPYING for the license.

About

*Experimental* implementation of HTTP/2 server push for NGINX

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 100.0%