Nginx:主域上的 Nuxtjs 应用程序 + 子目录中的 WordPress

Nginx: Nuxtjs app on main domain + WordPress in a subdirectory

我有一个 nuxtjs 应用程序 https://damjanun.com/ running on main domain with nginx proxy setup. Now we need to install wordpress inside a sub-directory i.e: https://damjanun.com/blog。我无法完成它。

找到解决方案。这是 damjanun.com 的 nginx 配置文件。该博客也运行良好 https://damjanun.com/blog

location /blog {
   try_files $uri $uri/ /blog/index.php?q=;
}

location ~ \.php$ {
   include snippets/fastcgi-php.conf;
   fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}

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;
}