# Reverse proxy https-\>http and resource/connection protection

**URL:** <https://www.ruby-forum.com/t/reverse-proxy-https-http-and-resource-connection-protection/199801>\
**Category:** NGINX\
**Created:** [November 29, 2010, 3:18pm UTC](https://www.ruby-forum.com/t/reverse-proxy-https-http-and-resource-connection-protection/199801 "2010-11-29T15:18:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [November 29, 2010, 3:18pm UTC](https://www.ruby-forum.com/t/reverse-proxy-https-http-and-resource-connection-protection/199801/1 "2010-11-29T15:18:54Z")

</div>

Hello nginx users,

Like to have one IP with reverse proxy (https-\>http) site,  
using wildchard certificates (multiple virtual hosts on one IP and  
using different upstreams for different subdomains.

Currently implemented in a testcase like:

```
location / {
       if ($http_host = urla.domain.com ) {
        proxy_pass http://urla.domain;
        break;
       }

       if ($http_host = urlb.domain.com ) {
        proxy_pass http://urlb.domain.com;
        break;
       }

```

}

and works fine (functional) not tested in production yet.

Using different upstreams i’m worried if one upstream fails or might get  
overloaded in a terrible way (say urla), the other upstream (say urlb)  
wil eventualy fail as wel, as nginx may use up all it’s resources for  
the problem upstream.

For that i’d like to limit the max connections on a subdomain, and i’m  
not seeing yet how to do that.  
I can limit the complete server {} definition using limit\_conn for  
example, but that doesn’t exacly cover this case.

How would one do that? splitting the servers definition, and using up  
extra IP’s ?

Thanks in advance,

Regards,

–  
Arjan Filius  
[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
