Welcome! Log In Create A New Profile

Advanced

Proxy pass protocol version HTTP/2

Posted by kostyarin_ 
Proxy pass protocol version HTTP/2
October 12, 2015 03:15PM
Hello!

I use nginx-1.9.5 with ngx_http_v2_module.
I want to pass HTTP/1.x traffic to one backend and HTTP/2 traffic to another. I don't want to convert HTTP/2 trafic to HTTP/1.x.
Is it possible?

As I know the proxy_http_version directive allows only 1.0 and 1.1.

My config:

http {
    # HTTP/2 vs HTTP/1.x proxy port
    map $http2 $site_ru_proxy_port {
        default  9000; # pass to HTTP/1.x backend
        "h2"      9001; # pass to HTTP/2 bakend
    }
    
    # HTTP/1.x + HTTP/2 over TLS
    server {
        listen               443 ssl http2;
        server_name  site.ru;
    
        # SSL STUFF
    
        location / {
            proxy_pass     http://127.0.0.1:$site_ru_proxy_port;
        }
    }
}
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 125
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready