Last active
October 10, 2017 16:54
-
-
Save hosseinm1997/412fb330f1d7290efac8f96ebe7ae29e to your computer and use it in GitHub Desktop.
Nginx server block (virtual host) for laravel 5.* and php 7.1
This file contains 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; | |
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