Is there a difference between using upstream and fastcgi_pass?

antriver asked:

Is there any difference between doing this:

upstream hhvm {
    server unix:/var/run/hhvm/hhvm.sock;
location ~ \.(hh|php)$ {
    fastcgi_pass hhvm;

and this:

location ~ \.(hh|php)$ {
    fastcgi_pass unix:/var/run/hhvm/hhvm.sock;

Which is preferable?

My answer:

Using upstream allows you to do some simple load balancing between multiple backends. If you have only one backend (as seems to be the case) then it doesn’t really buy you anything.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.