Skip to content

Instantly share code, notes, and snippets.

@anointed
Created July 23, 2013 23:38
Show Gist options
  • Save anointed/6067060 to your computer and use it in GitHub Desktop.
Save anointed/6067060 to your computer and use it in GitHub Desktop.
pagespeed errors on start, this is default.conf file I am using
server {
## Your website name goes here.
server_name mysite.com www.mysite.com;
## Your only path reference.
root /var/www/;
listen 8080;
## This should be in your http block and if it is, it's not needed here.
index index.php index.html index.htm ;
include conf.d/drop;
location / {
# This is cool because no php is touched for static content
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~ \.php$ {
fastcgi_buffers 8 256k;
fastcgi_buffer_size 128k;
fastcgi_intercept_errors on;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/dev/shm/php-fpm-www.sock;
}
pagespeed on;
# Needs to exist and be writable by nginx.
pagespeed FileCachePath /var/ngx_pagespeed_cache;
# Ensure requests for pagespeed optimized resources go to the pagespeed handler
# and no extraneous headers get set.
location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
add_header "" "";
}
location ~ "^/ngx_pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }
location /ngx_pagespeed_statistics { allow 127.0.0.1; deny all; }
location /ngx_pagespeed_message { allow 127.0.0.1; deny all; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment