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
17
3
2 months ago 00:13:16 2
Discover New PHP Attributes, Number Defaults, and Taylor’s New Composer Script 🧙
2 months ago 01:21:58 1
Bootstrapping an email service provider (with Jesse Hanley)
2 months ago 00:08:12 4
My Personal Livewire Starter Kit
2 months ago 00:03:11 1
Laravel Migrations “Trick“: Rename File Timestamp to Run Earlier
2 months ago 00:14:00 4
Execute Code After a Response is Returned?
3 months ago 00:36:03 9
Analyzing Analytical Databases | Jess Archer at Laracon US 2024 in Dallas, TX
3 months ago 00:14:37 2
Track user events in Laravel | Real World Laravel
3 months ago 00:10:11 4
Keeping Users in the Loop | Background Job Status Updates with Laravel Livewire
3 months ago 00:00:00 2
PHPUgly Livestream Episode 396
3 months ago 00:04:06 4
Laravel Chaperone Method
3 months ago 00:06:37 1
Building a Blog with LLM Agents: Automating Laravel Development
3 months ago 00:35:20 2
Mingle JS - Use React or Vue components in Livewire | LCP №5
3 months ago 00:52:42 1
North Meets South - 161 - Remote pairing around rounding errors with a pint
4 months ago 00:23:34 5
Self-Made SaaS 1.5 - Crash Course in Laravel
4 months ago 00:05:25 2
How to Install Laravel UI Auth in Bootstrap | Laravel 10 Tutorial
4 months ago 00:08:49 11
Benchmarking Laravel with Swoole, FrankenPHP, RoadRunner, php-fpm, and ngx-php
4 months ago 00:35:57 1
Live Stream - Upgrading from Laravel 5.8 with Shift (Part 3)
4 months ago 00:47:47 1
Live Stream - Upgrading from Laravel 5.8 with Shift (Part 2)
4 months ago 00:24:29 1
LaraconIn 2024 - Karuna Purohit :: The Yogic Theory of Training Subconscious Mind
4 months ago 00:03:30 5
PhpScript?? Well, it’s running locally in your browser! With WASM, locally and local webserver!
5 months ago 00:29:01 1
Live Stream - Backfilling tests for an existing Laravel application
5 months ago 00:09:16 1
Running PHPCBF Automatically with GitHub Actions
5 months ago 00:54:11 1
Live Stream - Upgrading to Laravel 11 with Shift
5 months ago 00:16:47 4
Laravel Custom Command Tutorial 🧙♂️ Learn How to Build Commands!