Can't access to my Nuxt Front End

Posted January 21, 2021 553 views
NginxNode.jsVue.jsDigitalOcean Droplets

Hello to everyone and thanks for reading;

This is my first time using Digital Ocean and I’m having a few problems to get going. I’m trying to deploy a PWA E-commerce based on Nuxt and Strapi. I deployed Strapi with the one-click deploy and it works perfectly, but I don’t know how to set up the front end.

I created the droplet with ubuntu 18 and setted up the non-root user with admin privileges and the firewall. After that, I’ve installed NodeJs (14.15 via PPA) and NPM, I’ve copied the files of Nuxt via SCP on
/home/my-user/project and then installing Nginx configuring the location to point to localhost:3000 , then I’ve ran the command npm install / npm run build, the page generates correctly, finally installing PM2 to run the page. I’ve tested the configuration in Nginx and is allright, I ran the command curl http://localhost and returns the whole html doc (because I’ve already built and compiled the files with the Nuxt build ) but after getting all this done, I try to go to the droplet public ip to only get Conection Timed Out.

I’ve done this whole process a couple of times, following the official guides and another tutorials that I’ve found and of trusted sources (like Medium) but at this point I'don’t know what else to do. Is from the configuration of my server?
Thanks in advance for the help!

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.

Submit an Answer
1 answer

Hi there @Parich15,

It sounds like that the Nginx service is not running or you might have a firewall blocking the traffic.

I would recommend the following:

  • Make sure that port 80 is open via your firwall. If you are using a firewall like UFW you can do that with ufw allow 80

  • Make sure that Nginx is up and running:

  • sudo systemctl status nginx

If it is not running try to start it with:

  • sudo systemctl start nginx

If it fails to start, you can run a config test with:

sudo nginx -t

And also check your error log:

tail -100 /var/log/nginx/error.log

Hope that this helps!