Nginx multiple IPs to origin
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;
}
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/
}