Skip to content

Instantly share code, notes, and snippets.

@tsawler
Created December 31, 2015 16:46
Show Gist options
  • Select an option

  • Save tsawler/d325903ff6672702aa83 to your computer and use it in GitHub Desktop.

Select an option

Save tsawler/d325903ff6672702aa83 to your computer and use it in GitHub Desktop.
nginx configuration if you are *not* using /vagrant/public for document root. This file goes in /etc/nginx/sites-available/default
server {
listen 80;
server_name localhost;
root /vagrant;
index index.php index.html index.htm;
location / {
try_files $uri $uri $uri/ =404;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
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