Code Monkey home page Code Monkey logo

ngx_http_autoquic_module's Introduction

ngx_http_autoquic_module

The Nginx module to upgrade and fallback HTTP version automatically for nginx-quic.

Installation

This module should be installed by adding option --add-moduleat configure phase.

$ cd nginx-quic
$ git clone https://github.com/Water-Melon/ngx_http_autoquic_module.git
$ ./auto/configure --with-debug --with-http_v3_module       \
                       --with-cc-opt="-I../boringssl/include"   \
                       --with-ld-opt="-L../boringssl/build/ssl  \
                                      -L../boringssl/build/crypto"
                       ...
                       --add-module=ngx_http_autoquic_module
$ make && make install

Directives

  1. autoquic

    • Syntax: autoquic on|off;
    • Default: off
    • Context: http
    • Description: to activate this module or not.
  2. autoquic_header

    • Syntax: autoquic header_key "header_value";
    • Default: -
    • Context: http
    • Description: if upgrade is allowed, the header indicated by header_key and header_value will be added in response headers.
  3. autoquic_fallback

    • Syntax: autoquic_fallback on|off;
    • Default: off
    • Context: http
    • Description: to activate version fallback or not.
  4. autoquic_fallback_period

    • Syntax: autoquic_fallback_period seconds;
    • Default: 30s
    • Context: http
    • Description: to set the minimum duration time after verion upgraded.

Example

http {
    autoquic on;
    autoquic_fallback on;
    autoquic_header Alt-Svc '$http3=":443"; quic=":443"; h3=":443"; ma=86400';
    autoquic_header QUIC-Status $quic;
    autoquic_fallback_period 30;

    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen 443 ssl;              # TCP listener for HTTP/1.1
        listen 443 http3 reuseport;  # UDP listener for QUIC+HTTP/3

        server_name example.com;

        ssl_protocols       TLSv1.3; # QUIC requires TLS 1.3
        ssl_early_data      on;
        quic_retry          on;
        ssl_certificate     certs/example.com.crt;
        ssl_certificate_key certs/example.com.key;

        location / {
            root   html;
            index  index.html index.htm;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }

}

ngx_http_autoquic_module's People

Contributors

water-melon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

merry1314

ngx_http_autoquic_module's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.