By mcode
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!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Have you checked your cros configuration on your node application? { origin: ‘*’, //replace this with your domain name optionsSuccessStatus: 200, methods: “GET, PUT, DELETE” }
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.