I had the same problem which was that I copy/pasted the config code from the web and some dirty EOL
(end of line) characters where there.
The editor didn't show them, but nginx
treated them like a directive.
Just deleted every EOL
and added again.