Priority of directives in general, listen, server etc

What is the priority of directives? E.g. If I set http keep-alive in general or listen, but have just one backend that need to be set to httpclose, does that have priority over the settings on the other level(s)?

Specific directives in locations always overwrite global or default configurations for that specific location.