How a web server passes an incoming HTTP request to your Rails application

Have you ever wondered about the config.ru file in your Rails app? How does a web server (e.g. Puma) talk to your Rails app? What does it mean for Rails to be a Rack app? And what’s a middleware? These are all related, let’s understand how!