If it helps here is the sites conf:
server {
server_name .<domain>.org;
access_log /var/log/nginx/www.<domain>.org-access.log main buffer=32k;
error_log /var/log/nginx/www.<domain>.org-error.log error;
# expires max;
# limit_req zone=iapp burst=200 nodelay;
listen 443 ssl;
ssl on;
# ssl_session_cache shared:SSL:10m;
ssl_certificate /path;
ssl_certificate_key /path;
root /var/empty;
rewrite ^
http://www. permanent;
}
server {
listen 80;
# listen 443 ssl;
# limit_req zone=iapp burst=200 nodelay;
server_name .<domain>.org;
root /var/path;
error_page 401 /error_page.php?c=401;
error_page 403 /error_page.php?c=403;
error_page 404 /error_page.php?c=404;
error_page 500 /error_page.php?c=500;
error_page 502 503 504 /error_page.php?c=50x;
add_header Cache-Control "public";
# add_header Strict-Transport-Security "max-age=315360000; includeSubdomains";
# ssl on;
# ssl_session_cache shared:SSL:10m;
# ssl_certificate /etc/nginx/ssl/path;
# ssl_certificate_key /etc/nginx/ssl/path;
access_log /var/log/nginx/www.<domain>.org-access.log main buffer=32k;
error_log /var/log/nginx/www.<domain>.org-error.log error;
# Redirects non-www to www
if ($host = '<domain>.org') {
rewrite ^/(.*)
http://www. permanent;
}
location / {
index index.php;
## Only server pages to the these domain requests.
if ($host !~ ^(<domain>.org|www.<domain>.org|live.<domain>.org)$ ) {
return 444;
}
## Only honor http GET HEAD and POST. This will ignore all others.
if ($request_method !~ ^(GET|HEAD|POST)$ ) {
return 444;
}
## So long as all the previous tests have passed, load the rewritten index.php page.
try_files $uri $uri/ @ee;
}
## create the reference rewrite and the rewrite rule.
location @ee {
rewrite ^(.*) /index.php?/$1 last;
}
## Deny access to hidden files (start with .)
location ~ /\. {
access_log off;
log_not_found off;
deny all;
}
location /search/crawl {
rewrite ^(.*) /index.php?/$1 last;
allow 127.0.0.1;
deny all;
}
location /<path>/crawl {
rewrite ^(.*) /index.php?/$1 last;
allow 127.0.0.1;
deny all;
}
## Don't log access to thes files
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
## Only allow our network to these types of files.
location ~* \.(rb|log)$ {
deny all;
}
location ~ \.(jpe?g|png|gif|mp3|pdf|flv)$ {
valid_referers none blocked <domain>.org *.<domain>.org;
if ($invalid_referer) {
return 403;
}
}
location =/error_page.php {
fastcgi_pass unix:/tmp/phpfpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
internal;
}
## Web conference alias and flash video settings
location ^~ /media {
## Block specific agents, mostly bots that don't honor our robots.txt file.
if ($http_user_agent ~ "Wget/|Teleport Pro|WebCopier|fetch|Download|Alligator|FileHound|free-downloads.net|Charon/|BackStreet|EyeCatcher|FDM|FreshDownloads"){
return 403;
}
root /var/www/;
flv;
}
## Setup the expires for caching static files. max=Dec 31, 2037, 1y=One Year, 31d=31 Days, 24h=24 Hours
# location ~* ^.+\.(js|css|png|jpg|jpeg|gif|ico)$ {
# access_log off;
# expires off;
# }
location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
# Some basic cache-control for static files to be sent to the browser
expires off;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
## This is the index.php specific settings
location /index.php {
include fastcgi_params;
set $script $uri;
set $path_info $uri;
# this will set the path_info when it exists as query string: /index.php?/something/here
if ($args ~* "^(/.+)$") {
set $path_info $1;
}
fastcgi_intercept_errors on;
fastcgi_pass unix:/tmp/phpfpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $path_info;
}
## These will process all other .php pages
location ~ \.php$ {
if (!-f $document_root$fastcgi_script_name){
return 404;
}
fastcgi_pass_request_body off;
client_body_in_file_only clean;
fastcgi_param REQUEST_BODY_FILE $request_body_file;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_intercept_errors on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/tmp/phpfpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}