Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deploy whole Wordpress app in Nuxt app?

Is there any possibiliy to deploy full wordpress app in Nuxt app? I mean I want to have adress foo.com of my app and on foo.com/bar will be wordpress app. Is there any way to do this? Nuxt router will be able to deal with this?

Wordpress API and iframe aren't answers, which I look for. As I said i want to deploy whole wordpress on specific adress of my Nuxt app.

like image 740
BobiDaHombre Avatar asked Nov 15 '22 23:11

BobiDaHombre


1 Answers

A bit of background

  • NuxtJS (build as static) is a client side app.
  • WordPress is a PHP server side app
  • A wordpress site usually get served to users by web servers like apache or nginx.
  • Client side apps served by any web server (including apache or nginx)

So you can't "deploy wordpress in nuxt", but it is simple to get what you want:

  1. Follow this guide to move the wordpress to a subdirectory
  2. Upload the nuxt app to the root directory

In case you are using SSR or any other requirements that force you to use Nuxt in server mode, your options are:

  • Setup nginx as reverse proxy
  • Setup apache as reverse proxy
  • Setup a proxy in the node server itself, maybe this project could help
like image 76
yeya Avatar answered Dec 04 '22 08:12

yeya