We reached too many replies, so I started a new answer.
@communityservice wrotesudo netstat -tulpn | grep -e 6000 -e 6001
resulted in below
tcp 0 0 18.104.22.168:6000 0.0.0.0:* LISTEN 24317/./appname
It looks like before. First of all, you need to change the settings in your app configuration to make it listening on localhost (127.0.0.1), not on public IP address (22.214.171.124 in the example). Otherwise, the configuration I sent you will not work, you will have two services listening on your public IP port 6000, the app and nginx.
@communityservice wroteanything that I did wrong?
Or was I supposed to add it to some other file? Or maybe creating sym link?
You can add new server blocks to your existing file as well as to a new file. In the first case you do not have to care about creating a symlink.
@communityservice wrotenginx: [warn] the “ssl” directive is deprecated, use the “listen … ssl” directive instead in /etc/nginx/sites-enabled/domain.com:48
It is just a warning but it would be good to fix it too. What is your directive in line 48 of the file /etc/nginx/sites-enabled/domain.com ?
And remember to restart nginx service after changing its configuration. First check if the syntax of config files is OK, of course :)
sudo nginx -t
sudo systemctl restart nginx