Skip to content

Instantly share code, notes, and snippets.

@ariews
Created March 22, 2013 06:40
Show Gist options
  • Save ariews/5219428 to your computer and use it in GitHub Desktop.
Save ariews/5219428 to your computer and use it in GitHub Desktop.
#
# Server Debian 6
# Nginx 1.2.7
#
server {
listen 80;
server_name arie.malam.or.id;
root /opt/sites/arie.malam.or.id;
index index.php;
access_log /var/log/nginx/arie.malam.or.id-access.log;
error_log /var/log/nginx/arie.malam.or.id-error.log;
location / {
try_files $uri $uri/ @mybackend;
}
location ~* ^/(themes|uploads)/(.*)\.(bmp|css|doc|gif|gz|ico|jpe?g?|js|pdf|png|svg|swf|tar|tiff|zip)$ {
root /opt/sites/arie.malam.or.id;
expires 30d;
}
location ~* /(favicon.ico|robots.txt) {
log_not_found off;
access_log off;
expires 1y;
}
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
location ~* \.php$ {
try_files $uri $uri/ @mybackend;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location @mybackend {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment