Score:0

Nginx multiple IPs to origin

br flag

I need to set up Nginx as a reverse proxy to my origin. The origin has a restriction of 50 concurrent HTTP connections per IP address.

My Ubuntu server has multiple IPs attached to it. I want to use these IPs to achieve more than 50 concurrent requests to my origin.

Below is how I am trying to do it. I have created multiple server blocks where each block listens on a particular IP. I have also added the public IPs in the DNS records to achieve round-robin DNS.

Now, If I have 3 nginx "server" blocks as follows. I am hoping that a different IP will be sent to my origin based on the server block used to make the request? So, I will be able to achieve theoretically, 150 concurrent requests (if there were 50 people resolving DNS to each IP).

Please let me know if my setup is correct?

 server {

            listen 1.1.1.1:80;
            server_name proxy.site.net;
            proxy_pass https://example.com/
            proxy_bind 1.1.1.1 transparent;
 }
 
  server {

            listen 1.1.1.2:80;
            server_name proxy.site.net;
            proxy_pass https://example.com/
            proxy_bind 1.1.1.2 transparent;
 }
 
  server {

            listen 1.1.1.3:80;
            server_name proxy.site.net;
            proxy_pass https://example.com/
            proxy_bind 1.1.1.3 transparent;
 }
Score:2
th flag

You can use the listen directive multiple times in the server block

Sample Config

 server {

            listen 1.1.1.1:80;
            listen 1.1.1.2:80;
            listen 1.1.1.3:80;

            server_name proxy.site.net;
            proxy_pass https://example.com/
 }
br flag
Thanks for the correction. So I am assuming that the client resolves to 1.1.1.1 will achieve 50 concurrent connections to the origin because 1.1.1.1 will be sent to the origin by the Niginx. Similarly 1.1.1.2 and 1.1.1.3. So my assumption is correct that I can achieve more than 50 concurrent connections to origin using this method?
br flag
Just "proxy_bind" directive in my code. As I think it is needed to forward the IP to origin. Let me know if I can have multiple proxy_bind in the same server block?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.