I have a Laravel App and separate Vue app that I want to deploy to a Droplet. I have not combined Vue into the Laravel app. I know how to setup Laravel on the server and get that running but how can I setup Nginx Blocks and the Vue app so that when a someone visits the domain name they are taken to the Vue app?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
What you could do is first set up your server and deploy your Laravel application as per this tutorial here:
If you have a domain name you could use something like api.example.com as the server_name.
Once your Laravel application has been deployed, you can create a new directory at /var/www/example.com and upload your VueJS project there. After that, you can create a new Nginx server block for your main domain and use example.com as the servername and change the document root to /var/www/example.com.
That way when you visit api.example.com you will reach your Laravel installation and when you visit example.com you will be seeing your VueJS application thanks to the separate Nginx server blocks.
Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.