Skip to content

Instantly share code, notes, and snippets.

@shernshiou
Created March 31, 2014 03:46
Show Gist options
  • Save shernshiou/9884876 to your computer and use it in GitHub Desktop.
Save shernshiou/9884876 to your computer and use it in GitHub Desktop.
# Blog running on Ghost in Nodejs
server {
listen 80;
server_name blog.shernshiou.com;
#access_log /var/log/nginx/log/blog.access.log;
client_max_body_size 5M;
location / {
proxy_pass http://LOCALHOST:GHOST_PORT/;
proxy_set_header Host $host;
proxy_buffering off;
}
location ~ ^/(assets)/ {
gzip_static on;
root /path/to/Ghost/content/themes/casper;
expires max;
add_header Cache-Control public;
add_header Last-Modified "";
add_header ETag "";
break;
}
location ~ ^/(shared)/ {
gzip_static on;
root /path/to/Ghost/core;
expires max;
add_header Cache-Control public;
add_header Last-Modified "";
add_header ETag "";
break;
}
location ~ ^/(content/images)/ {
gzip_static on;
root /path/to/Ghost;
expires max;
add_header Cache-Control public;
add_header Last-Modified "";
add_header ETag "";
break;
}
pagespeed EnableFilters rewrite_css;
pagespeed EnableFilters rewrite_javascript;
pagespeed EnableFilters rewrite_images;
# 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