How do I do what I did in htaccess in nginx?

See the link I gave you … Running other websites on the same machine as Discourse

I’m sure you can derive solution from it…