Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The process for deploying Nuxt with nginx can be summarized in the following steps:

  1. Build your Nuxt application locally by running npm run build.

  2. Copy the generated dist directory to your server.

  3. Install nginx on your server.

  4. Edit the nginx configuration file (/etc/nginx/nginx.conf) to add a new server block that listens on the desired port and forwards traffic to your Nuxt application. The configuration file should look something like this:

server {
  listen 80;

  root /path/to/dist;
  index index.html;

  location / {
    try_files $uri $uri/ /index.html;
  }
}
  1. Restart nginx to apply the new configuration.

  2. Configure your DNS settings (if necessary) to point your domain name to your server's IP address.

  3. Access your Nuxt application through your domain name or IP address in a web browser.

Note: These steps are a general guide and may vary depending on your specific environment and deployment needs. It is recommended to consult the official Nuxt.js and nginx documentation for more detailed information.