Skip to content

Instantly share code, notes, and snippets.

@jfengq
Created April 24, 2016 14:00
Show Gist options
  • Save jfengq/654fd198ba63876fbdb9464c0442ccce to your computer and use it in GitHub Desktop.
Save jfengq/654fd198ba63876fbdb9464c0442ccce to your computer and use it in GitHub Desktop.
server {
server_name domainname.com www.domainname.com;
root /var/www/;
listen 80;
index index.html index.htm index.php;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* \.(css|js|png|jpg|jpeg|gif|ico)$ {
expires 1d;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment