Run Laravel in a subdirectory with Nginx (full, working config)
We get Laravel working in a subdirectory, using Nginx configuration. This is great for multiple Laravel installations, or when you just have a second Laravel running inside of any subdirectory.
The Laravel code base is not literally in a subdirectory of a parent code base, instead we just use Nginx routing to make the URL routes behave as if it is.
▶ The original content for this article is here:
▶ The docs for Nginx’s use of alias is here: #alias
▶ Info on using $request_filename with alias here: #use-request-filename-for-script-filename
⚠️ Don’t forget that if you have 2 Laravel apps under the same domain, you’ll need to give each their own unique session name (usually by editing the APP_NAME env var, but you can check your config/ file to see your options).
⌚️ Timestamps
00:00 Intro
00:12 What we’ll build up to
01:00 Nginx Configuration
03:53 Fixing SCRIPT_FILENAME
06:37 Using rewrites
08:21 Two notes
2 views
19
5
4 years ago 00:05:02 8
How To Fix “Laravel Mix NPM run dev error” | Laravel Mix Error | Compiling Error Laravel
5 years ago 00:02:36 10
Laravel GUI Package: Run Artisan without Terminal
4 years ago 00:04:55 7
Laravel Task Scheduling: Run Artisan Command Hourly
4 years ago 00:29:01 6
Laravel Quiz Test Run
5 years ago 00:16:55 27
Running Scheduled Laravel Tasks with Docker
4 years ago 00:05:58 7
Github Actions in Laravel: Run PHPUnit on Every Pull Request
5 years ago 00:12:46 9
Running Laravel on AWS Lambda with Bref
4 years ago 00:24:18 8
Cache in Laravel | How to Create Cache in Laravel | How to Use Cache in Laravel
5 years ago 00:19:33 21
Canvas - Laravel Publishing Platform
9 years ago 00:03:25 208
Simple Laravel 5 Authentication
4 years ago 00:12:28 2
5 Tools to Quickly Run Laravel Commands with Tinker
4 years ago 00:20:23 17
Introduction to Laravel Commands! 👨💻
5 years ago 00:07:33 11
Laravel Sail | First Party Laravel Docker Environment | Laravel + Docker for Development
9 years ago 00:02:49 677
01 - Composer & The Laravel Installer
9 months ago 00:03:11 1
Laravel Migrations “Trick“: Rename File Timestamp to Run Earlier
5 years ago 00:05:53 12
Multitenancy in Laravel: Updating configuration at runtime
4 years ago 00:18:46 5
Up And Running with Laravel Sail
7 years ago 00:10:47 22
Laravel Core Adventures - The Laravel Request Lifecycle Level 3
4 years ago 00:17:29 17
Laravel Junior Code Review: Security and Consistency
4 years ago 00:06:37 9
Englightn: Laravel Project Health Check in Seconds
7 years ago 00:08:41 33
Компиляция CSS- и JS-файлов в Laravel
10 months ago 00:14:37 2
Track user events in Laravel | Real World Laravel
6 years ago 00:04:56 100
Laravel Framework Visualization 2011 - 2019
5 years ago 00:12:02 12
Multitenancy in Laravel: Migrations, Testing, and switching tenants