Skip to content

Instantly share code, notes, and snippets.

@MikeRogers0
Created July 7, 2014 21:34
Show Gist options
  • Save MikeRogers0/081aaaad2df35d2fb858 to your computer and use it in GitHub Desktop.
Save MikeRogers0/081aaaad2df35d2fb858 to your computer and use it in GitHub Desktop.
My NGINX conf for PHP sites
server {
listen 80;
server_name _;
root /vagrant/www;
index index.html index.htm index.php;
expires -1;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
# pass the PHP scripts to FastCGI server listening socket
location ~ \.php$ {
fastcgi_pass unix://var/run/php5-fpm.sock;
fastcgi_keep_conn on;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
fastcgi_read_timeout 360;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment