Skip to content

Instantly share code, notes, and snippets.

@trungpv1601

trungpv1601/config

Created Jul 14, 2017
Embed
What would you like to do?
Laravel in a Sub Directory with NGINX
location ^~ /xxx {
alias /var/www/xxx/public;
try_files $uri $uri/ @xxx;
location ~* \.php {
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /var/www/xxx/public/index.php;
}
}
location @xxx {
rewrite ^/xxx/(.*)$ /xxx/index.php/$1 last; # THIS IS THE IMPORTANT LINE
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment