server {
listen 80;
server_name www.apple4me.us apple4me.us;
return 301 http://apple4me.net$uri;
}
server {
listen 80;
server_name www.apple4me.org apple4me.org;
return 301 http://apple4me.net$uri;
}
server {
listen 80;
server_name www.apple4me.net;
return 301 http://apple4me.net$uri;
}
server {
listen 80;
server_name apple4me.net;
rewrite ^/(.*)/favicon.ico$ /favicon.ico last;
error_log /var/log/nginx/apple-error.log warn;
access_log /var/log/nginx/apple-access.log;
root /var/www/apple4me;
#end changes needed to begin
location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
allow 199.48.164.159;
allow 24.49.69.204;
deny all;.
}
location / {
#This sends everything through index.php and keeps the appended
#query string intact.
try_files $uri $uri/ /index.php?$uri&$args;
index index.html index.htm index.php;
rewrite /(robots.txt)$ /robots.php last;
#gzip it, gzip it good
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_min_length 1100;
gzip_buffers 64 8k;
gzip_comp_level 2;
gzip_proxied any;
gzip_types text/xml text/plain text/css application/json application/x-javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype application/xml application
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
# use fastcgi for all php files
location ~ \.php$ {
# Zero-day exploit defense.
# http://forum.nginx.org/read.php?2,88845,page=3
try_files $uri /index.php =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# Feed
location ~* \.(?:rss|atom)$ {
expires 1h;
add_header Cache-Control "public";
}
# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
}
# CSS and Javascript
location ~* \.(?:css|js)$ {
expires 1y;
access_log off;
add_header Cache-Control "public";
}
# WebFonts expires
# If you are NOT using cross-domain-fonts.conf, uncomment the following directive
location ~* \.(?:ttf|ttc|otf|eot|woff|font.css)$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
}
#protect the innocent
location ~ ^/community/(internal_data|library)/(.*)$ {
internal;
}
# deny access to apache .htaccess files
location ~ /\.ht
{
deny all;
}
}