In Rails 3, railties defines a default middleware stack (railties / lib / rails / application.rb) that allows each type of middleware to access a request call. The first module on the stack is ActionDispatch :: Static (you can disable it using config.serve_static_assets). The static middleware module is in ActionPack (actionpack / lib / action_dispatch / middleware / static.rb). Matching lines:
path = env['PATH_INFO'].chomp('/')
...
if file_exist?(path)
return @file_server.call(env)
@file_server is defined above as a Rack :: File, which is located in the /lib/rack/file.rb rack. It simply reads the file and serves the contents as a body.
So, when do you delete index.html, file_exist? a call that simply passes the request to the next middleware and eventually ends up in a regular Rails router.