It's much variants described in Internet how to display maintenance page with nginx. But I didn't find the solution to check if user is a developer and not to display maintenance page for developers.
I use try_files, which does't works as I need after any IF-section was entered. So I made my own solution, which I want to share. It works in any configuration with try_files, proxy and so on.