Is it possible to host a Strapi CMS and the front-end application (also running on NodeJS) that consumes the Strapi API on the same droplet? Is it possible to use sub-domains to direct tot he 2 apps? e.g. admin.domain.com for Strapi and domain.com just loads the public app?
I’m really a novice when it comes to hosting/deployment so appreciate any advice.
Thanks!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $100 of credit to try our products over 60 days!
Hello,
Yes, this would not be a problem. What you would need keep in mind is:
Make sure that the Strapi and the Node.js applications are running on different ports, for example, start Strapi on port 1337 as suggested in the documentation.
You can take a look at the steps on how to install Strapi on a DigitalOcean Droplet here:
https://strapi.io/documentation/3.0.0-alpha.x/guides/deployment.html#digital-ocean
Then you can start Node.js on port 8080 for example.
Finally install Nginx and set it up as a reverse proxy for your Node.js application:
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04
admin.domain.com
subdomain name as you mentioned. The Nginx proxy rules that you would need to add for the Strapi application would be a bit different to the Node.js ones, you can use the following:Hope that this helps! Let me know if you have any questions. Regards, Bobby
hello can you help me? I bought a droplet with strapi and I have error when I assign strapi to a subdomain when assigning my strapi to a subdomain admin.mydomain.com first the login image disappears, I get a 404 not found error and when entering admin.mydomain.com/admin I get an error 405 in / admin / init. Help please I am hazing on strapi and hosting it in production in the vps