簡體   English   中英

無法在數字海洋上部署nuxt

[英]Unable to deploy nuxt on digital ocean

一段時間以來,我一直在嘗試在數字海洋上部署 nuxt,但我一直無法這樣做。 我已經按照以下教程來實現這一目標。

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

然而,盡管付出了很多努力,該網站仍未啟動。 給我以下錯誤無法訪問此站點\nvlancer.me 響應時間太長。

以下是我遵循的步驟

  1. git 克隆
  2. npm 安裝
  3. npm 運行構建
  4. npm 開始在此處輸入圖像描述
  5. 然后嘗試通過 vlancer.me 和 vlancer.me 上的瀏覽器進行連接:3000 錯誤顯示 This site can't be reached。

甚至嘗試通過 nginx 進行反向代理

/etc/nginx/sites-available/vlancer.me(也符號鏈接 /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;
    }
}

找到了解決方案。 所有教程都跳過此命令 如果您已通過 nginx 設置反向代理,請執行此操作

sudo ufw enable 80

如果不這樣做

sudo ufw enable 3000

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM