Using Ghost as an npm module isn’t really recommended, is there a reason you want to take that approach?
The recommended approach would be to install two ghost instances and when prompted specify the url with the subdirectory, you can then configure the subdirectory proxies as part of your parent app’s web server config.
I’m trying to find a way to create multiple blogs in one website and I didn’t know that using Ghost as an npm module isn’t recommended. I’m fine with installing two ghost instances.
Could you elaborate more on how to install two ghost instances? Should I create a new directory for each ghost instance e.g. /blog for the first ghost instance and /blog2 for the second ghost instance?
Also when you say “configure the subdirectory proxies as part of your parent app’s web server config”, do you mean configure nginx to redirect the http request to the corresponding ghost instance?
Exactly! Create a directory for the first blog and run ghost install inside of it, then create a directory for the second blog and run ghost install inside of that.
Yes, configure nginx but to proxy rather than redirect. Eg, adapting Ghost-CLI’s default nginx template:
Replacing the locations and 2368/2369 ports to correspond with your desired sub-directories and the ports that were set up for you when installing the respective ghost instances.