Sweet. Thank @eva2000! :D
Code (Text): pagespeed Domain cdn.example.com; pagespeed LoadFromFile "https://cdn.example.com" "/home/nginx/domains/example.com/public"; @eva2000 why would someone want to pull images out of a local image folder (let's assume that the /public is /uploads which is what I use) and sever them as images from cdn.example.com? My CDN is pulling a files from the uploads directory on my server. That entire folder is already on the cdn's server. I wonder how useful pagespeed is when using a CDN. The CDN is already dealing with the css and image files, unless pagespeed is going to optimize those resources even more.
You're telling ngx_pagepseed to allow optimising css, js, and images from the cdn Domain you listed and allow CDN to serve those optimised assets. CDN's generally don't auto optimise/minify static assets and resize/optimise image sizes unless they have such settings i.e. Cloudflare.
1. Found an issue when clicking on the hide post. Modal pops up, but no option to enter the reason or button to actually hide the content. With PS off, it works. 2. @eva2000 I'm not understanding which is the best way to do this. I guess your way is correct, because I just turned off ps and got the error below. Never got that before running the config without the LoadFile options. Code: # pscontrol off rm: cannot remove ‘/var/ngx_pagespeed_cache/v3/example.com/https,3A/,2Fcdn.example.com/uploads’: Directory not empty systemctl restart nginx.service 3. Not sure I'd run this in a production environment until more testing. My registrations dropped by a lot yesterday (day after I started using it) not sure if PS is blocking something or what.
you running command as full root user ? as you shouldn't get that though i do see ascii characters wrapping in early single quotes instead. Make sure your SSH client encoding is set to UTF-8.
Are you referring to the client I use on my computer? If so, everything is set to UTF-8. It's probably something in my conf file because I was running the CMM stock version with no issues.
yeah could be as never had that issue and here's pscontrol off code lines nothing i see should cause that if running commands as root user centminmod/centminmod
Haven't tested this out yet, but I believe these are the correct lines: Code: # Enable rewrite_domains when using CDN. pagespeed EnableFilters rewrite_domains; # Information on Origin Pull CDNs # https://www.webfoobar.com/node/79 # DOMAIN1.COM INFO pagespeed Domain https://domain1.com; pagespeed MapRewriteDomain https://cdn.domain1.com https://domain1.com; pagespeed Disallow "https://domain1.com/<admin_folder>/*"; pagespeed Disallow "https://domain1.com/admin/*"; pagespeed Disallow "https://domain1.com/*do=quote*"; pagespeed Disallow "https://domain1.com/page/index.html"; # DOMAIN1.COM INFO pagespeed Domain https://domain2.com; pagespeed MapRewriteDomain https://cdn.domain2.com https://domain2.com; pagespeed Disallow "https://domain2.com/<admin_folder>/*"; pagespeed Disallow "https://domain2.com/admin/*"; pagespeed Disallow "https://domain2.com/*do=quote*"; pagespeed Disallow "https://domain2.com/page/index.html";
Well, that's config isn't working. Randomly switching images when the image uses the IPB image proxy.
Not really much else to say. The image is replaced w/ another image from the site. 1. The user creates a thread. 2. Pastes in some text along with a few images from another source. 3. IPB uses an image proxy so that all images will be https when viewed. Code: https://example.com/applications/core/interface/imageproxy/imageproxy.php?img=https://somesite.com/image/something.jpg 4. Image above gets randomly replaced by an image from another thread. When pagespeed is turned off, it works fine. Not sure if the image proxy is messing something up. There's pagespeed, a CDN, and a proxy. A lot of stuff going on.
it's because proxy image ends in image extension that pagespeed picks up i.e. something.jpg Just exclude / disallow the imageproxy.php file from ngx_pagespeed Code (Text): pagespeed Disallow */imageproxy/imageproxy.php*;
After I typed my last post it dawned on me to do exactly what you said. We'll give that a try and see what happens.
I wonder if it's better to include the line in each domain vs. one line like you have above? Code: # DOMAIN1.COM INFO pagespeed Domain https://domain1.com; pagespeed MapRewriteDomain https://cdn.domain1.com https://domain1.com; pagespeed Disallow "https://domain1.com/applications/core/interface/imageproxy/*"; pagespeed Disallow "https://domain1.com/admin/*"; pagespeed Disallow "https://domain1.com/*do=quote*"; pagespeed Disallow "https://domain1.com/page/index.html";
i just use what i posted wildcard.. if you ever have more than one forum on same server, that would exclude them all
I was more worried about the "pagespeed Domain" lines and if your line needed to be at the end of the file after the "pagespeed Domain" or before the "pagespeed Domain" lines.
https://www.modpagespeed.com/doc/restricting_urls So, I guess putting it at the end of the file is best. Since wildcards can be used, I can reduce the number lines in the conf file.