How to host a Laravel web app in NGINX
How to host a laravel web app in NGINX
Are you trying to find a way to host a pure Laravel app on NGINX?
Well you're in luck because in this blog you can find the answer on how to do it.
-
-
- First go to your project directory:
- Run npm install to install the packages needed
- then run npm run build
- next configure the sites-available in nginx directory
- you can use this:
server {
server_name your_url.com;
index index.php index.html index.htm;
root the/directory/of/your/laravel/webapp;
}
- First go to your project directory:
-
You can use this guide too if you are trying to host a Laravel project with Vue.js. as per my experience hosting this way is the most easiest than containerizing it or running it as a pm2 instance, sure their is an Apache way to host it too if you we're wondering. but with this set-up changing or deleting something from your website is easy from an intruder point of view so for production purposes it is still best if you containerize your project.