upstream app_front_static {
    server 192.168.206.105:80;
}

Never seen it before, anyone knows, what it means?

automatix's user avatar

automatix

14.6k31 gold badges118 silver badges245 bronze badges

asked May 4, 2011 at 2:47

gdb's user avatar

gdbgdb

7,81913 gold badges41 silver badges37 bronze badges

It's used for proxying requests to other servers.

An example from http://wiki.nginx.org/LoadBalanceExample is:

http {
  upstream myproject {
    server 127.0.0.1:8000 weight=3;
    server 127.0.0.1:8001;
    server 127.0.0.1:8002;    
    server 127.0.0.1:8003;
  }

  server {
    listen 80;
    server_name www.domain.com;
    location / {
      proxy_pass http://myproject;
    }
  }
}

This means all requests for / go to the any of the servers listed under upstream XXX, with a preference for port 8000.

Bahrom's user avatar

Bahrom

4,87234 silver badges44 bronze badges

answered May 4, 2011 at 2:56

Phil Lello's user avatar

Phil LelloPhil Lello

8,6392 gold badges27 silver badges36 bronze badges

2

If we have a single server we can directly include it in the proxy_pass directive. For example:

  server {
    ...
    location / {
      proxy_pass http://192.168.206.105:80;
      ...
    }
  }

But in case if we have many servers we use upstream to maintain the servers. Nginx will load-balance based on the incoming traffic, as shown in this answer.

McLan's user avatar

McLan

2,6989 gold badges55 silver badges91 bronze badges

answered Oct 14, 2020 at 13:32

satyanarayana's user avatar

1

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.