LoginSignup
0
0

More than 5 years have passed since last update.

Laravel homestead のサブディレクトリ運用

Posted at

基本
http://qiita.com/yyano/items/a0d141a91ba8d867985e
こちらの記事のとおりですが、どうもハマったので記載しておきます。以下の内容を記載する。

location ^~ /サブディレクトリ名 {
    alias "publicへのフルパス";

    try_files $uri $uri/ @subrewrite;
    location ~* \.php {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME publicへのフルパス/index.php;
    }
}
location @subrewrite {
    rewrite ^/サブディレクトリ名/(.*)$ /サブディレクトリ名/index.php/$1 last; # THIS IS THE IMPORTANT LINE
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0