简体   繁体   中英

Unable to deploy nuxt on digital ocean

I have been trying to deploy nuxt on digital ocean for a while now but I have been unable to do so. I have followed the following tutorial to achieve this.

https://kaloraat.com/articles/how-to-deploy-nuxtjs-ssr-app-to-digital-ocean

However, despite numerous efforts the site won't launch. Giving me the following error This site can't be reached\nvlancer.me took too long to respond.

The following are the steps I followed

  1. git clone
  2. npm install
  3. npm run build
  4. npm start 在此处输入图像描述
  5. Then tried to connect through the browser on both vlancer.me and vlancer.me:3000 the error shows up This site can't be reached.

Even tried reverse proxying through nginx

/etc/nginx/sites-available/vlancer.me(also symlinked /etc/nginx/sites-enabled/vlancer.me)


server {
    listen 80;
    listen [::]:80;
    index index.html;
    server_name vlancer.me www.vlancer.me;

    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

Found the solution. All the tutorial skip out on this command Do this if you have set up reverse proxy through nginx

sudo ufw enable 80

If not do this

sudo ufw enable 3000

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM