I have this requirement. I want to use nginx as the reverse proxy, which
listen on address A and forward the request to the backend server with
address B. However, if B is down, I want the request to be sent to
address C. The question is, address B is https and address C is http.
But for the argument of proxy_pass module, I can only write one prefix
(either “http” or “https”).
upstream backend {
server :;
server : backup;
}
location / {
proxy_pass http://backend; #here, only one prefix is allowed
}
So how to config to meet my requirements? Or here I shouldn’t use
upstream but other approach?
On Sun, Apr 17, 2011 at 2:24 PM, speedfirst [email protected]
wrote:
I have this requirement. I want to use nginx as the reverse proxy, which
listen on address A and forward the request to the backend server with
address B. However, if B is down, I want the request to be sent to
address C. The question is, address B is https and address C is http.
But for the argument of proxy_pass module, I can only write one prefix
(either “http” or “https”).
you’re not supposed to proxy to https backend. And I don’t know how
mixed environment like that would work anyway. If the client isn’t
using SSL then what’s the point. But then if it’s SSL then who
supposed to give out the certificate.
So we would like to be able to have one set of common definitions for
locations that work under SSL and non-SSL where we “pass along” the SSL
nature of the connection (let’s not get into the discussion of whether
or if
that is a good idea or not).