簡體   English   中英

503 由於維護停機或容量問題,服務器暫時無法為您的請求提供服務。 請稍后再試。 nuxt.js

[英]503 The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later. nuxt js

我的網站運行良好,然后我更新nuxt.config.js 然后,該站點開始顯示Service Unavailable

我正在使用 pm2 啟動/部署應用程序。 它的 vps 服務器中有 apache。

它的顯示:

服務不可用 由於維護停機或容量問題,服務器暫時無法為您的請求提供服務。 請稍后再試。

但是,如果我運行npm run dev網站加載正常,沒有任何問題。 另外,我用pm2 list檢查了狀態,它顯示應用程序在線。

我的 package.json

{
  "name": "nuxtjs",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "dev": "nuxt --hostname domain.link --port 49000",
    "build": "nuxt build",
    "start": "nuxt start",
    "generate": "nuxt generate",
    "deploy": "pm2 start npm --name nuxtjs -- start"
  },
  "dependencies": {
    "@nuxtjs/axios": "^5.13.6",
    "@yeger/vue-masonry-wall": "^3.0.16",
    "core-js": "^3.19.3",
    "nuxt": "^2.15.8",
    "pm2": "^5.1.2",
    "vue": "^2.6.14",
    "vue-server-renderer": "^2.6.14",
    "vue-template-compiler": "^2.6.14",
    "webpack": "^4.46.0"
  },
  "devDependencies": {},
  "config": {
    "nuxt": {
      "host": "0.0.0.0",
      "port": "49000"
    }
  }
}

我的 nuxt.config:

import { join } from "path";
export default {
  target: "static",
  // Global page headers: https://go.nuxtjs.dev/config-head
  head: {
    title: "Project Title",
    htmlAttrs: {
      lang: "en",
    },
    meta: [
      { charset: "utf-8" },
      { name: "viewport", content: "width=device-width, initial-scale=1" },
      { hid: "description", name: "description", content: "" },
      { name: "format-detection", content: "telephone=no" },
      { property: "og:title", content: "Project Title" },
      {
        property: "og:image",
        content: "https://lovealabradoodle.com/images/two.jpg",
      },
      {
        property: "og:description",
        content:
          "Content here",
      },
    ],
    link: [
      { rel: "icon", type: "image/x-icon", href: "/favicon.ico" },
      {
        rel: "stylesheet",
        href: "https://fonts.googleapis.com/css?family=Roboto:400,600,700%7CMontserrat:400,500,600,700",
      },
      {
        rel: "stylesheet",
        href: "https://use.fontawesome.com/releases/v5.15.4/css/all.css",
      },
      {
        rel: "stylesheet",
        href: join("/", `fonts/flaticon/flaticon.css`),
      },
      {
        rel: "stylesheet",
        href: join("/", `css/bootstrap.min.css`),
      },
      {
        rel: "stylesheet",
        href: join("/", `css/plugins.css`),
      },
      {
        rel: "stylesheet",
        href: join("/", `css/magnific-popup.css`),
      },
      {
        rel: "stylesheet",
        href: join("/", `css/aos.css`),
      },
      {
        rel: "stylesheet",
        href: join("/", `css/style.css`),
      },
      {
        rel: "stylesheet",
        href: join("/", `css/styles/maincolors.css`),
      },
    ],
    script: [
      // {
      //   src: "js/jquery.min.js",
      //   body: true,
      // },
      {
        src: join("/", `js/bootstrap.bundle.min.js`),
        body: true,
      },
      {
        src: join("/", `js/imagesloaded.pkgd.min.js`),
        body: true,
      },
      {
        src: join("/", `js/isotope.pkgd.min.js`),
        body: true,
      },
      {
        src: join("/", `js/jquery.magnific-popup.min.js`),
        body: true,
      },
      {
        src: join("/", `js/easing.min.js`),
        body: true,
      },
      {
        src: join("/", `js/aos.js`),
        body: true,
      },
      {
        src: join("/", `js/custom-nuxt.js`),
        body: true,
      },
    ],
    bodyAttrs: {
      id: "top",
    },
  },

  // Global CSS: https://go.nuxtjs.dev/config-css
  css: [
    // "~/static/css/bootstrap.min.css",
    // "~/static/css/plugins.css",
    // "~/static/css/magnific-popup.css",
    // "~/static/css/aos.css",
    // "~/static/css/style.css",
    // "~/static/css/styles/maincolors.css",
  ],
  //Global JS
  //   script: [
  // "~assets/js/custom.js"
  //   ],

  // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
  plugins: [],

  // Auto import components: https://go.nuxtjs.dev/config-components
  components: {
    path: "~/components", // will get any components nested in let's say /components/test too
    pathPrefix: false,
  },

  // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  buildModules: [],

  // Modules: https://go.nuxtjs.dev/config-modules
  modules: [
    // https://go.nuxtjs.dev/axios
    "@nuxtjs/axios",
  ],

  // Axios module configuration: https://go.nuxtjs.dev/config-axios
  axios: {
    // Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308
    baseURL: "http://api.domain.link/api",
    retry: { retries: 3 },
  },
  publicRuntimeConfig: {
    axios: {
      baseURL: "http://api.domain.link/api",
    },
  },
  // Build Configuration: https://go.nuxtjs.dev/config-build
  build: {
    extractCSS: true,
  },
};

我運行了 yarn/npm install,它對我有用

暫無
暫無

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

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