Skip to content

Instantly share code, notes, and snippets.

@jeffersonsouza
Created August 29, 2015 17:26
Show Gist options
  • Select an option

  • Save jeffersonsouza/3ea0d3cc344c0093d0c6 to your computer and use it in GitHub Desktop.

Select an option

Save jeffersonsouza/3ea0d3cc344c0093d0c6 to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name yoursite.com;
root /var/www/your-site/public;
index index.php index.html index.htm;
error_log /var/log/nginx/ys_error_log;
location / {
try_files $uri $uri/ /index.php?$query_string;
add_header 'Access-Control-Allow-Origin' '*';
}
include /usr/local/nginx/conf.d/php-fpm.conf;
include /usr/local/nginx/common.conf;
# disable CoreFilters
#pagespeed RewriteLevel PassThrough;
# enable collapse whitespace filter
#pagespeed EnableFilters collapse_whitespace;
# enable JavaScript library offload
#pagespeed EnableFilters canonicalize_javascript_libraries;
# combine multiple CSS files into one
#pagespeed EnableFilters combine_css;
# combine multiple JavaScript files into one
#pagespeed EnableFilters combine_javascript;
# remove tags with default attributes
#pagespeed EnableFilters elide_attributes;
# improve resource cacheability
#pagespeed EnableFilters extend_cache;
# flatten CSS files by replacing @import with the imported file
#pagespeed EnableFilters flatten_css_imports;
#pagespeed CssFlattenMaxBytes 5120;
# defer the loading of images which are not visible to the client
#pagespeed EnableFilters lazyload_images;
# enable JavaScript minification
#pagespeed EnableFilters rewrite_javascript;
# enable image optimization
#pagespeed EnableFilters rewrite_images;
# pre-solve DNS lookup
#pagespeed EnableFilters insert_dns_prefetch;
# rewrite CSS to load page-rendering CSS rules first.
#pagespeed EnableFilters prioritize_critical_css;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment