mkdir /var/www/laravel
vim /etc/nginx/sites-available/default
#replace default with https://gist.github.com/dikaio/601ec9b09b5a282db8b78ab89f1ad92bvim /etc/php/7.0/fpm/php.ini
#change cgi.fix_pathinfo=1 with 0=vim /etc/php/7.0/fpm/pool.d/www.conf
#change line,listen = 127.0.0.1:9000
tolisten = /run/php/php7.0-fpm.sock
- sudo service php7.0-fpm restart && sudo service nginx restart
- curl -sS https://getcomposer.org/installer | php
- mv composer.phar /usr/local/bin/composer
- composer create-project laravel/laravel /var/www/laravel/ 4.2
- chgrp -R www-data /var/www/laravel && chmod -R 775 /var/www/laravel/app/storage
Created
June 29, 2017 08:16
-
-
Save crushcafeteria/3bcf0afa8f6e6042ef491643d9c93ba5 to your computer and use it in GitHub Desktop.
Sample Nginx Laravel Server Block
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
server { | |
listen 80 default_server; | |
root /var/www/laravel/public; | |
index index.php index.html index.htm; | |
server_name _; | |
location / { | |
try_files $uri $uri/ /index.php$is_args$args; | |
} | |
location ~ \.php$ { | |
try_files $uri /index.php = 404; | |
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment