Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Differences between Ruby web servers and others like nginx [closed]

Tags:

ruby

server

rack

This one's a doozy, but bear with me.

What's the difference between HAProxy, apache/nginx, rack, (thin, puma, mongrel, webrick) and an application server?

It seems that Rack always uses one of the aforementioned web servers, so why doesn't it ever use nginx? Seems like nginx is some other breed of server.

like image 517
dsp_099 Avatar asked Dec 02 '25 18:12

dsp_099


1 Answers

Rack is an interface, a specification, for application servers in Ruby. These application servers typically take in HTTP requests and return HTTP responses over either TCP ports or unix sockets. Ruby web apps will leverage one of the app servers that implement the Rack specification (thin, puma, unicorn, etc). You wouldn't usually expose the application server directly to the internet for a variety of reasons, one of the most important being that these application servers are meant to be a bridge between application code and http, not to stand up to the wide open internet. So, the app server typically has a web server, like nginx or apache, sitting in front of it. It's very common to have http requests coming into nginx on port 80 and then having nginx distributing those requests to one or more rack application servers running on a different port.

like image 123
Adam Avatar answered Dec 04 '25 07:12

Adam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!