It would work but you need to mind one thing, what context is this file going to be included to.
In your condition it's a location block, so you need to include it inside a server block, not http for example,
Also use full path not relative
server {
# bla bla
include /etc/nginx/.redirects;
}