Skip to content

Instantly share code, notes, and snippets.

@hosseinm1997
Last active October 10, 2017 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hosseinm1997/412fb330f1d7290efac8f96ebe7ae29e to your computer and use it in GitHub Desktop.
Save hosseinm1997/412fb330f1d7290efac8f96ebe7ae29e to your computer and use it in GitHub Desktop.
Nginx server block (virtual host) for laravel 5.* and php 7.1
server {
listen 80;
server_name mylaravelproj.me www.mylaravelproj.me;
root /var/www/mylaravelproj.me/public;
index index.html index.php index.htm;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri =404;
# use the value /etc/php-fpm.d/www.conf listen part
# 1 uncomment listen
# 2 set user and group part to nginx
# 3 set listen.owner and listen.group part to nobody
# 4 save the file and service php-fpm restart
fastcgi_pass 127.0.0.1:9000;
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