Quantcast
Channel: Nginx Forum - Nginx Mailing List - English
Viewing all articles
Browse latest Browse all 7229

proxying to upstream port based on scheme (no replies)

$
0
0
I have an httpd upstream server that listen on both http and https at
different port and want to send all http=>http_upstream and https =>
https_upstream

The following does the trick

#####################
if ( $scheme = https ) {
set $port 4430;
}
if ( $scheme = http ) {
set $port 9999;
}

location / {

proxy_pass $scheme://127.0.0.1:$port;
}
#####################

Just wanted to know if this is very inefficient (if-being evil) than
hard-coding the port and having two different server{} blocks for http and
https .

Thanks in advance.



--
*Anoop P Alias*
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Viewing all articles
Browse latest Browse all 7229

Trending Articles



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