Loading...
「ツール」は右上に移動しました。
利用したサーバー: wtserver1
147いいね 4,081 views回再生

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: https://serversforhackers.com/c/nginx...

▶ The docs for Nginx’s use of alias is here: https://nginx.org/en/docs/http/ngx_ht...

▶ Info on using $request_filename with alias here: https://www.nginx.com/resources/wiki/...

⚠️ 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/session.php 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

コメント