mod_pagespeed stops .html pages > 1023 characters from displaying

57 views
Skip to first unread message

JW

unread,
Nov 22, 2017, 6:15:09 AM11/22/17
to mod-pagespeed-discuss
I've just discovered that having mod_pagespeed enabled stops web pages with the .html or .htm extension that are longer than 1023 characters from displaying in the browser. The page just comes up as blank.

If I rename the file to .txt or .js or .php then the same file will display in full.

Also, if I append ?PageSpeed=off to the url of the .html file to disable mod_pagespeed, the file will display.

Why is this, and how do I fix it? It does the same across multiple servers/domains with mod_pagespeed installed, and I haven't changed any of the default PageSpeed configuration settings.

Thanks.

Longinos

unread,
Nov 22, 2017, 6:50:49 AM11/22/17
to mod-pagespeed-discuss
Have you tied the ?PageSpeedFilters=+debug This add debug comments that you can see in the html code

JW

unread,
Nov 22, 2017, 7:12:58 AM11/22/17
to mod-pagespeed-discuss
Yes, I've tried that, but with PageSpeed enabled it doesn't output anything, not even the debug comments.

Here's a few test files:

1023 character html file with PageSpeed enabled: https://www.turnround.co.uk/1023.html OK
1024 character html file with PageSpeed enabled: https://www.turnround.co.uk/1024.html NOT OK
1024 character text file with PageSpeed enabled: https://www.turnround.co.uk/1024.txt OK
1024 character html file with PageSpeed disabled: https://www.turnround.co.uk/1024.html?PageSpeed=off  OK

I just don't understand what's going on. Can't find anything related to 1024 characters and HTML in config files.

Thanks.

Otto van der Schaaf

unread,
Nov 22, 2017, 8:55:45 AM11/22/17
to mod-pagesp...@googlegroups.com
The mod_pagespeed version is 1.12.34.2 right?  This doesn't look like a known issue to me. 
With the empty response on https://www.turnround.co.uk/1024.tx a 0 content-length header is present in the response.
It looks like nginx is running in front of the Apache server. Does the problem also happen when you query the webserver directly, bypassing nginx?

Otto


--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/9a7bf4a8-83cd-4831-86b5-466b72f4a51d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

JW

unread,
Nov 22, 2017, 9:04:36 AM11/22/17
to mod-pagespeed-discuss
Yes, mod_pagespeed version 1.12.34.2-0

I've just turned off nginx and all works ok. So, I guess it's a problem between pagespeed and nginx, but I don't know what.

Is there something I can configure to get them to play nicely together?

Thanks.

To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

Otto van der Schaaf

unread,
Nov 22, 2017, 9:28:13 AM11/22/17
to mod-pagesp...@googlegroups.com
Is there anything special in the nginx reverse proxy configuration?
It would be helpful to see a capture of a raw request/response between nginx and apache to assess this.

Otto

To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/5385cda6-9c24-419b-af76-793c9ad43099%40googlegroups.com.

JW

unread,
Nov 22, 2017, 9:50:23 AM11/22/17
to mod-pagespeed-discuss
Below is the nginx_ip_default.conf file for the domain. It's just the default as configured by Plesk when turning on nginx - no modifications made. Then there's the additional nginx directives I added in vhost_nginx.conf (via Plesk), which I've also tried removing but it makes no difference.

I'm afraid I'm a web server novice, so I don't know how to capture the raw request/response between nginx and apache. If you can point me towards some fairly straightforward step-by-step instructions, I'm happy to try.

Thanks.


nginx_ip_default.conf:

#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.

server {
listen 77.68.89.109:443 default_server ssl http2;

server_name turnround.co.uk;
server_name www.turnround.co.uk;
server_name ipv4.turnround.co.uk;

ssl_certificate             /usr/local/psa/var/certificates/cert-pef1jl;
ssl_certificate_key         /usr/local/psa/var/certificates/cert-pef1jl;
ssl_client_certificate      /usr/local/psa/var/certificates/cert-qIAZlm;

client_max_body_size 128m;

root "/var/www/vhosts/turnround.co.uk/httpdocs";
access_log "/var/www/vhosts/system/turnround.co.uk/logs/proxy_access_ssl_log";
error_log "/var/www/vhosts/system/turnround.co.uk/logs/proxy_error_log";

location ^~ /plesk-site-preview/ {
proxy_set_header Host             plesk-site-preview.local;
proxy_set_header X-Real-IP        $remote_addr;
proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
proxy_cookie_domain plesk-site-preview.local $host;
access_log off;
}

if ($host ~* ^turnround\.co\.uk$) {
rewrite ^(.*)$ https://www.turnround.co.uk$1 permanent;
}

#extension wp-toolkit begin

#extension wp-toolkit end

location / {
proxy_set_header Host             $host;
proxy_set_header X-Real-IP        $remote_addr;
proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
proxy_set_header X-Accel-Internal /internal-nginx-static-location;
access_log off;
}

location /internal-nginx-static-location/ {
alias /var/www/vhosts/turnround.co.uk/httpdocs/;
internal;
}

location ~ ^/(plesk-stat|awstats-icon|webstat|webstat-ssl|ftpstat|anon_ftpstat) {
proxy_set_header Host             $host;
proxy_set_header X-Real-IP        $remote_addr;
proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
proxy_set_header X-Accel-Internal /internal-nginx-static-location;
access_log off;
}

location ~ ^/files/ {
proxy_set_header Host             $host;
proxy_set_header X-Real-IP        $remote_addr;
proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
proxy_set_header X-Accel-Internal /internal-nginx-static-location;
access_log off;
}

add_header X-Powered-By PleskLin;

include "/var/www/vhosts/system/turnround.co.uk/conf/vhost_nginx.conf";
}

server {
listen 77.68.89.109:80 default_server;

server_name turnround.co.uk;
server_name www.turnround.co.uk;
server_name ipv4.turnround.co.uk;

client_max_body_size 128m;

if ($host ~* ^turnround\.co\.uk$) {
return 301 https://www.$host$request_uri;
}
return 301 https://$host$request_uri;
}

vhost_nginx.conf:

gzip            on;
gzip_min_length 1000;
gzip_proxied    expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/x-javascript application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

This

unread,
Dec 7, 2017, 5:11:31 AM12/7/17
to mod-pagespeed-discuss
If you have Plesk + nginx,

go to "Websites & Domains" => Apache & nginx Settings and deselect "Smart static files processing"



Then "Apply".

JW

unread,
Dec 7, 2017, 5:21:53 AM12/7/17
to mod-pagespeed-discuss
Thanks very much! That does fix the issue and allow the HTML files > 1023 characters to display.

I had noticed that setting, but the "Turn off this option only for troubleshooting." warning stopped me from trying it out without knowing the consequences.

Are there any drawbacks to having that setting turned off?

This

unread,
Dec 7, 2017, 7:02:22 AM12/7/17
to mod-pagespeed-discuss
I am not an expert, anyway I think that there are no drawbacks, except that every file will be processed by apache: nginx process the static files much better than apache.
The solution I choose has been to rename the file extension from *.html to *.php and set the Smart Static File Processing on.
Reply all
Reply to author
Forward
0 new messages