Skip to content

Instantly share code, notes, and snippets.

@abyshakes
Created April 24, 2015 08:21
Show Gist options
  • Save abyshakes/d1126a84c004f3b0f15d to your computer and use it in GitHub Desktop.
Save abyshakes/d1126a84c004f3b0f15d to your computer and use it in GitHub Desktop.
Laravel Nginx Subdirectory
location ^~ /apis {
alias /usr/share/nginx/aby_api/public;
try_files $uri $uri/ @laravel;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
location @laravel {
rewrite /apis/(.*)$ /apis/index.php?$1 last;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment