Skip to content

Instantly share code, notes, and snippets.

@torniker
Created May 13, 2015 11:16
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 torniker/d09db27177e158568a51 to your computer and use it in GitHub Desktop.
Save torniker/d09db27177e158568a51 to your computer and use it in GitHub Desktop.
Nginx phpfmp configuration for laravel
upstream phpfcgi {
server phpfpm:9000;
}
server {
listen 80 default;
server_name local.dev;
root /var/www/public;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri /index.php =404;
include /etc/nginx/fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass phpfcgi;
fastcgi_param SCRIPT_FILENAME /var/www/html/public$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_index index.php;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment