Upstream to both https or http

speedfirst nginx-forum at
Sun Apr 17 11:24:57 MSD 2011

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 <addr B ip>:<addr B port>;
      server <addr C ip>:<addr C port> 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?


Posted at Nginx Forum:,191822,191822#msg-191822

More information about the nginx mailing list