while i am on putty terminal, when i type *vi /etc/nginx/conf.d/yourdomain.com.conf *command, it gives me a blank page ( sort of ) ( not new window or something ) and i am adding this line as instructed

after i added these lines, i don't know how to save while i am on putty so i am closing putty and it asks to me that " are you sure to close this session" so, i am saying "yes" and reopen putty to making further progress.

when i check the conf file i've created via filezilla, it is compiled so i can't see if it is set as it should be or not.

I mean i can't see this lines on file.

So Am i doing something wrong on putty ? Is there command or something that file i added those lines and save it while i am on putty without closing putty and see how it went ?

It's possible that the file isn't being saved when you close PuTTy. By doing so you are terminating the SSH session and forcing vim (the text editor) to quit. Once you run sudo vi /etc/nginx/conf.d/yourdomain.com.conf, press i and then paste in the nginx config. Then, press Escape then :. Type wq and press Enter. This will save the file and exit vim.

You might prefer to use a different editor such as nano which is a bit easier to use. sudo nano /etc/nginx/conf.d/yourdomain.com.conf, paste your config file, and press ctrl-x to save. Follow the prompt the bottom.

Make sure you restart nginx after adding the config file. That should be it.

No in this case you would not need a root directive since you are using NGINX as a proxy server. The 500 error is noting that there is a problem with your backend server, in this case its nodejs for nodebb, you will need to ensure it is up and running.

@Kayrah that error means that nginx did not receive a proper response from http://localhost:4567. Either NodeBB isn't running or is returning an error. Check nginx's error logs as well as NodeBB's. See if there's anything in there that might help.

sudo tail -n 50 /var/log/nginx/error.log

This command will print the last 50 lines of nginx's error log. Run the same one on NodeBB's error log, It should be somewhere in /opt/forum/nodebb.