Search…

X3 Photo Gallery Support Forums

Search…
 
netmax
Experienced
Topic Author
Posts: 52
Joined: 23 Dec 2006, 08:17

"Use X3 CDN" breaks site when SSL is used

04 May 2016, 16:07

Hi Karl,

after changing most of my sites to use SSL (HTTPS) suddenly most of my direkt links to particular pages in my X3 installation did not work anymore, presenting just some kind of weird HTML "framing" without content.

Debugging this in the browser console showed that some content (scripts) has been blocked due to mixed content. It seems that CDN wants to deliver the scripts via normal HTTP which is not allowed if the main site uses HTTPS.

Disabling the CDN delivery fixes the problem, but as far as I know you, you want to fix that in general 8)

Please remember: This does NOT happen if you just call the general domain (i.e. "https://myalbum.com"). The problem appears once you call directly a page, a picture etc, like "https://myalbum.com/album/animals/"

VBR,
Marco
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13998
Joined: 30 Sep 2006, 03:37

Re: "Use X3 CDN" breaks site when SSL is used

04 May 2016, 23:03

Why no link? This has a very simple explanation, and it's not a bug.

When you change to SSL, without updating the X3 pages, you have CACHED pages from the non-SSL version trying to load non-SSL CDN core assets via SSL page. This will create "insecure requests" which are blocked by the browser.

Furthermore, I can imagine that you now have BOTH SSL and NON-SSL versions of your website available? This will compound the issue. Why? First of all, because they are two different websites technically, and X3 will cache pages based on where the request comes from ... This will create cached X3 pages on your server, that suit one request method, but not the other. Furthermore, you should never have both SSL AND non-SSL available anyway, because it means your canonical page link will fluctuate, and this is not good for SEO either. Never should two different links be able to access the same page.
netmax wrote:Disabling the CDN delivery fixes the problem, but as far as I know you, you want to fix that in general
It is not a bug, we already have dozens of X3 websites running on SSL, including the demo if you noticed:
https://demo.photo.gallery/

You may therefore need to do the following:

1. Setup a redirect on your website to make sure ALL http requests are redirected to https. There is no logical reason why you would want to keep both http and https.

2. Make a small change in panel by clicking "save" somewhere, just to force the cached pages to refresh.

3. When pages are re-loaded from SSL, the CDN core assets will be loaded from a different SSL URL.

It will work fine.
 
netmax
Experienced
Topic Author
Posts: 52
Joined: 23 Dec 2006, 08:17

Re: "Use X3 CDN" breaks site when SSL is used

06 May 2016, 12:17

Hi Carl,

I really need to hammer this cache thing into my brain. I never had both versions of the website, I have a server side rewrite rule active to rewrite http to https. But after changing this I did not "save" something in the panel.

Rechecking the "CDN" network checkbox and "Save" has solved it. Thanks!
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13998
Joined: 30 Sep 2006, 03:37

Re: "Use X3 CDN" breaks site when SSL is used

07 May 2016, 01:44

Good! Was probably just that you needed to force X3 to refresh pages, as you had cached pages from non-SSL version.