Skip to content

Instantly share code, notes, and snippets.

@safecat
Last active August 29, 2015 14:04
Show Gist options
  • Save safecat/52274d8ffcedc07ccff3 to your computer and use it in GitHub Desktop.
Save safecat/52274d8ffcedc07ccff3 to your computer and use it in GitHub Desktop.
Laravel in Subfolder (rename public to subfolder name)
Laravel in Subfolder (rename public to subfolder name)
===INTRO===
Assume we need http://localhost/miao/ instead of http://localhost/laravel_app/public/
===FILES===
|laravel_app
|-app
|-bootstrap
|-miao(rename from public)
|-vendor
|-server.php
|-etc...
===Nginx===
location /miao {
root /www/laravel_app;
index index.php;
try_files $uri $uri/ $uri/index.php /miao/index.php?$args;
location ~ \.php(?|$) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
===bootstrap/paths.php===
'public' => __DIR__.'/../miao',
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment