Hello and thank you for your help.

I have created droplet on which I want to setup my project. I have managed to set up front (Angular/Nginx) and back (NodeJS) following this tutorial> https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04.

Back is working and properly connecting to my db and sending data that I can access when I type http://<server-api>:3000. Front is also working (I can access it on http://<server-api>) but not receiving data from the backend. I have tried to find a solution to the problem I have added reversed proxy to my default nginx file.

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
                proxy_pass http://localhost:3000;
                proxy_cache_bypass $http_upgrade;

        }

but when I add this I can’t reach http://<server-api>:3000 anymore.
General problem is I don’t understand how to connect front and back. Any help or instructions or what to look for next to understand problem would be welcome. Thank you!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer
Submit an Answer