Created
July 14, 2017 06:24
-
-
Save trungpv1601/553bc03722bd87b709667cc5efcfa82a to your computer and use it in GitHub Desktop.
Laravel in a Sub Directory with NGINX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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