Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Proxy pass protocol version HTTP/2

$
0
0
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;
        }
    }
}

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>