Welcome! Log In Create A New Profile

Advanced

Nginx multiple upstream with different protocols

Kilian Ries
February 22, 2017 10:42AM
Hi,


i'm trying to setup two Nginx upstreams (one with HTTP and one with HTTPS) and the proxy_pass module should decide which of the upstreams is serving "valid" content.


The config should look like this:


upstream proxy_backend {

server xxx.xx.188.53;

server xxx.xx.188.53:443;

}


server {

listen 443 ssl;

...

location / {

proxy_pass http://proxy_backend;

#proxy_pass https://proxy_backend;

}

}



The Problem is that i don't know if the upstream is serving the content via http or https. Is there any possibility to tell nginx to change the protocol from the proxy_pass directive? Because if i set proxy_pass to https, i get an error (502 / 400) if the upstream website is running on http and vice versa.


So i'm searching for a way to let Nginx decide if he should proxy_pass via http or https. Can anybody help me with that configuration?


Thanks

Greets

Kilian
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx multiple upstream with different protocols

Kilian Ries February 22, 2017 10:42AM

AW: Nginx multiple upstream with different protocols

Kilian Ries February 22, 2017 11:10AM

Re: Nginx multiple upstream with different protocols

B.R. via nginx February 22, 2017 12:54PM

AW: Nginx multiple upstream with different protocols

Kilian Ries February 23, 2017 05:40AM

Re: Nginx multiple upstream with different protocols

Andrei February 23, 2017 07:14AM

Re: AW: Nginx multiple upstream with different protocols

c0nw0nk February 23, 2017 07:38AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 259
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready