Multiple HTTP2 reverse proxy support ?

joseph-pg nginx-forum at forum.nginx.org
Mon Dec 11 16:19:07 UTC 2017


It's possible.

#put this in the http context
proxy_http_version 1.1; #default is HTTP/1.0

-

#example server blocks
#redirect to https
server {
    listen 80;
    server_name "~^(.+\.)?example\d{2}\.com$"; #regex to match
example[number].com and *.example[number].com
    return 301 https://$host$request_uri;
}

#https
#example01.com
server {
    listen 443 ssl http2;
    server_name  example01.com;

    proxy_pass http://10.0.2.2;

    #your config;
}

#foo.example01.com
server {
    listen 443 ssl http2;
    server_name  foo.example01.com;

    proxy_pass http://10.0.2.2:12000;

    #your config;
}

#example02.com
server {
    listen 443 ssl http2;
    server_name  example02.com;

    proxy_pass https://10.0.3.2;

    #your config;
}

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,277698,277733#msg-277733



More information about the nginx mailing list