Search code examples
vue.jslaravel-5lumen

How to deploy Laravel/Lumen Framework to the production server


I created a project using vue.js for the frontend and backend with laravel lumen framework and my question is how can I deploy my backend laravel/lumen to the production server ?

is there any specific commands ? by the way my production server setup running with Digitalocean Ubuntu droplet and I used Nginx as a web server


Solution

  • For this, i think we can have any of 3 solutions:
    Solution 1
    If you own a domain; set a subdomain for backend as api.yourdomain.com and access it through your frontend.
    Solution 2
    Configure your web server (apache/nginx/{whatever-you-use}) to listen on 80 for frontend request and listen on 81 or anyother port and use that url "yourdomain.com:81" for backend and access it through frontend.
    Solution 3
    Define a specific route for apis like "yourdomain.com/api" on your web server to use that location to point your backend lumen server and regular location / for frontend.