I'm guessing maybe nginx isn't configured correctly. I think you might be missing the below in the nginx config
server {
listen 80;
and
proxy_pass http://localhost:8065;
see https://github.com/mattermost/platform/blob/master/doc/install/Production-Ubuntu.md