Hi and thanks.
I pointed an A record for cdn.12flat.com in DNS to the IP of my server and created a path to it with my ssl and port. The path to my subdomain folder is /srv/12flat-images/ (as opposed to /srv/12flat/ which I have a copy of /wp-content and /wp-includes within. I looked in the db to find where AO specifies the path but you must be just grabbing that from wp so I cannot override.
In DB (for images) working fine.
upload_path – /srv/12flat-images/wp-content/uploads
upload_url_path – https://cdn.12flat.com/wp-content/uploads
Within the plugin (CDN Enabler)
CDN URL
https://cdn.12flat.com
Included Directories
wp-content,wp-includes
Relative Path (default: enabled).
-
This reply was modified 9 years, 1 month ago by
dblinks. Reason: for notify
ah, now I understand; AO expects the CDN to mirror the directory structure of the origin site (as a typical pull CDN works) and that files cached in the origin server are automatically available on the CDN (again; pull CDN).
if however you have a subdomain that points to a different place on the filesystem which is not in sync with the normal wordpress filesystem (specifically changes made in wp-content/cache/autoptimize) then this indeed will not work (as you’re not in a pull CDN scenario there).
maybe symlinking /srv/12flat/wp-content/cache to /srv/12flat-images/wp-content/cache can be a simple workaround?
I can symlink via cli but would rather hard code it in a nginx server block via a custom .conf file as I don’t want any conflicts with other sites on this machine.
I’m not exactly sure the syntax yet in that .conf file to pair/symlink them.
Thanks for your suggestion Frank.
if you can configure nginx to look at /srv/12flat-images/wp-content/ by default for the cdn subdomain, but at /srv/12flat/wp-content/cache/autoptimize for requests containing cache/autoptimize, then you’d be out of the woods. don’t know the first thing about nginx though … 🙂
OK, so this is interesting (based on your last conclusion). In AO I made //12flat.com/ the cdn and left https://cdn.12flat.com as the domain for the CDN Enabler plugin.
No error on the AO js file now… all other assets are using the cdn.
Your support exceeds expectations and suggestions push me to find ways to improve.
5 stars.
Probably will work just leaving the cdn blank in your plugin. As you said I’m not using “pull” so until I figure that out the site is performing well enough.