You aren't escaping your periods. Try like this:
location ~* \/(fileA|fileB)\.txt$ {
return 404 'nothing here';
}
You aren't escaping your periods. Try like this:
location ~* \/(fileA|fileB)\.txt$ {
return 404 'nothing here';
}