Skip to content

Instantly share code, notes, and snippets.

@eduardosacra
Forked from ac-silva/site-nginx
Last active August 29, 2015 14:26
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 eduardosacra/f9ba309f9d8acbde7c5e to your computer and use it in GitHub Desktop.
Save eduardosacra/f9ba309f9d8acbde7c5e to your computer and use it in GitHub Desktop.
server {
listen 80;
index index.php;
root /var/www/;
charset utf8;
location / {
gzip on;
try_files $uri/index.php $uri /index.php;
if (!-f $request_filename) {
rewrite (.*) /index.php;
}
}
location /admin {
index index.php;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 30d;
gzip on;
}
location ~ .*\.(js|css)?$ {
expires 1h;
}
# php fastcgi setting
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment