Setting up Discourse on a machine with existing Nginx

You can copy samples/standalone.yml.

You can edit discourse-setup to skip the test.

You can disable your web server long enough to run discourse-setup.

Getting discourse working is the easiest part of the advanced configuration that you are attempting.

Have a look at Running other websites on the same machine as Discourse. I believe there is another nginx specific topic.