Skip to content

Instantly share code, notes, and snippets.

@aligundogdu
Created May 12, 2013 19:18
Show Gist options
  • Save aligundogdu/5564586 to your computer and use it in GitHub Desktop.
Save aligundogdu/5564586 to your computer and use it in GitHub Desktop.
server {
listen 80; ## listen for ipv4; this line is default and implied
server_name .siteadi.com;
if ($host == 'www.siteadi.com' ) {
rewrite ^/(.*)$ http://siteadi.com/$1 permanent;
}
root /var/www/siteadi.com;
index index.php index.html index.htm;
server_name localhost;
location = /favicon.ico {
log_not_found off;
access_log off;
}
# location = /robots.txt {
# allow all;
# log_not_found off;
# access_log off;
# }
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
location ~* \.(jpg|jpeg|png|gif|css|js|ico)$ {
access_log off;
log_not_found off;
expires 360d;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
if ($http_user_agent ~* (aboundex) ) {
return 403;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment