-
AuthorPosts
-
May 17, 2016 at 4:32 pm #633825
google page speed, nginx 1.9, php 6.04 is used
May 17, 2016 at 4:35 pm #633828Solved by adding following to the directives:
location /{FOLDER} {
client_max_body_size 100M;try_files $uri $uri/ /{FOLDER}index.php$is_args$args;
# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;location ~* \.(jpg|jpeg|png|gif|css|js|ico)$ {
expires max;
log_not_found off;
}location ~ \.php$ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
{FASTCGIPASS}
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_intercept_errors on;fastcgi_temp_file_write_size 10m;
fastcgi_busy_buffers_size 512k;
fastcgi_buffer_size 512k;
fastcgi_buffers 16 512k;
fastcgi_read_timeout 1200;
<tmpl_if name=’php’ op=’==’ value=’hhvm’>error_page 500 501 502 503 = @phpfallback{FOLDERMD5};</tmpl_if>}
}<tmpl_if name=’php’ op=’==’ value=’hhvm’>
location @phpfallback{FOLDERMD5} {
client_max_body_size 100M;
try_files $uri =404;
include /etc/nginx/fastcgi_params;
{PHPFALLBACKFASTCGIPASS}
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_intercept_errors on;fastcgi_temp_file_write_size 10m;
fastcgi_busy_buffers_size 512k;
fastcgi_buffer_size 512k;
fastcgi_buffers 16 512k;
fastcgi_read_timeout 1200;
}
</tmpl_if>pagespeed on;
pagespeed FileCachePath /var/ngx_pagespeed_cache;
#pagespeed FetchHttps enable,allow_self_signed;
pagespeed XHeaderValue “Powered By ngx_pagespeed”;# let’s speed up PageSpeed by storing it in the super duper fast memcached
pagespeed MemcachedThreads 1;
pagespeed MemcachedServers “localhost:11211”;# Filter settings
pagespeed RewriteLevel CoreFilters;
pagespeed EnableFilters collapse_whitespace,remove_comments;# 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 “” “”;
access_log off;
}
location ~ “^/ngx_pagespeed_static/” {
access_log off;
}
location ~ “^/ngx_pagespeed_beacon$” {
access_log off;
}
location /ngx_pagespeed_statistics {
allow 127.0.0.1;
deny all;
access_log off;
}
location /ngx_pagespeed_global_statistics {
allow 127.0.0.1;
deny all;
access_log off;
}
location /ngx_pagespeed_message {
allow 127.0.0.1;
deny all;
access_log off;
}
location /pagespeed_console {
allow 127.0.0.1;
deny all;
access_log off;
}May 17, 2016 at 6:18 pm #633898Hi,
Glad to see a solution was found! Also thanks for sharing it here on the forum :)
Best regards,
Jordan -
AuthorPosts
- You must be logged in to reply to this topic.