Drupal 8 - Mixed Content for SVG icons - drupal

I use Drupal 8.
I try to load SVG icon files in HTTPS but in production, my website load each SVG icon file in HTTP.
Files are in core/themes/stable/images/core/icons/etc... as:
http://www.example.com/core/themes/stable/images/core/icons/bebebe/hamburger.svg
http://www.example.com/core/themes/stable/images/core/icons/787878/file.svg
On site-information page (http://www.example.com/admin/config/system/site-information), I have the URL in HTTP and not in HTTPS.
COuld you help me please, to force HTTPS to load SVG file?

It's maybe an issue due to a proxy in front of drupal. I faced exactly the same issue as yours and I've configured a reverse proxy in my settings.php file and it was solved.
You could give a try adding those lines to your settings.php :
$settings['reverse_proxy'] = TRUE;
$settings['reverse_proxy_addresses'] = array($_SERVER['REMOTE_ADDR']);
Also, there is a thread on drupal.org about the HTTPS issue : https://www.drupal.org/project/metatag/issues/2842049

Related

IIS site don't get CSS and JS in https (it is in http)

I have worked IIS site which has worked in HTTPS. Something break and now when i try to get it in https site looks like that without CSS styles. I see in source and CSS and JS files try to open as http (which get 404 error when I try to open it), but when i try to open it via https everything work. How to "force" these to open these files via https? URL rewrite rule, but how?
Thanks for help
This what you experiencing is "mixed content blocking". It occures when you reach website via https but some elements are via http.
To resolve the problem you should configure http to https redirection.
You can find 'how to' here: https://www.ssl.com/how-to/redirect-http-to-https-with-windows-iis-10/
Also make sure that you don't hardcoded links to application elements via http in app code (if yes then change to https).

After migrating WordPress website, got a new error when trying to view some images

I've just migrated a website live, and some images are coming up with a strange error:
"Error occured while calculating source (passed through env): No image roots defined in config."
Example URL: https://piktochart.com/wp-content/uploads/2019/07/Template-09-Lead-gen-handbook.jpg
Anyone seen this before?
This is only happening on some of the images. I cannot find the cause, I've disabled/re-enabled caching.
I've downloaded the images from the server and they look fine.
I have faced this issue on my own site,I managed, as well.
You can use a plugin that manipulates images, such as WebP Express? Check your htaccess file for rewrite rules involve jpg or png files. I used the above plugin, but it was disabled and the htaccess rules were left in place; trying to redirect images to a page that it couldn’t handle.
For me it was caused by Webp Express, the plugin also gave a notice: It seems your server setup does not support headers in .htaccess. You should either fix this (install mod_headers) or deactivate the "Enable direct redirection to existing converted images?" option. Otherwise the Vary:Accept header will not be added and this can result in problems for users behind proxy servers (ie used in larger companies)
Setting the Operation mode to "No conversion" solved my issue.

CDN Farfuture URLs not be working with Fastly, if enabled cacheable forever checkbox

Many thanks for your reply to my query, I want to ask you one more points on #1. Below is details for my query/issue:
On point #1, we can see this is "x-cache: MISS" in the response headers; we get the same behavior when requesting a given URL for the first time, so it does not appear to be a cached response. This is an existing site; we see this issue only with the combination of the Fastly domain and the farfuture feature enabled. It looks like Drupal might be issuing the 302 redirect, possibly to the root of the site, but I don't know how we can verify that.
Here is our settings from Drupal config for File System:
Public file system path
sites/us/files
Public file base URL
https://origin-domain.com/us/sites/us/files
Here are four different ways to request the same image; only the combination mentioned above is failing (i.e. get 302 redirect):
Working:
https://origin-domain.com/us/cdn/farfuture/7fPXsGzPQo7CUdilOBMTARjP_snit...
NOT working:
https://cdn-domain.com/us/cdn/farfuture/7fPXsGzPQo7CUdilOBMTARjP_snit7D3...
Working:
https://origin-domain.com/us/sites/us/files/coperta_30.jpg
Working:
https://cdn-domain.com/us/sites/us/files/coperta_30.jpg
Br,
Kapil P
Issue title: Fastly CDN-forever cachable issue
Issue description:
Hi team
I am using Faslty CDN network for my application, in which having issue in thumbnail creation and upload image on it.
I am using Drupal 8 version and CDN module to setup Fastly CDN configuration, When am upload image through CDN path it's upload file inside folder /Files/image.png, but at same time image is not uploading into thumbnail folder. But am disabled CDN configuration then image is uploading on both folder /files/ and /thumbnail/.
Below is details description with image path.
1.) works: https://cdn-doamin.com/us/sites/us/files/NorbFastlyTestThree_0.jpg
Not work: https://cdn-domain.com/us/sites/us/files/styles/thumbnail/public/NorbFas...
How does Drupal validate itok?
2.) works: https://cdn-domain.com/us/sites/us/files/coperta_30.jpg
Not working: https://cdn-domaine.com/us/cdn/farfuture/7fPXsGzPQo7CUdilOBMTARjP_snit7D...
Question about "forever cachable" - How does Drupal take the "/farfuture/dhsdhsadhjsbfbdueiu/" and know how to handle that?
Thanks,

some CSS can not show when swith the website from http to https

I have a website written in Ruby using Ruby on Rail framwork, everything was fine when using HTTP protocol, but when switching to HTTPS protocol.
Some CSS material can not shown, but some of it can.
The font can not be shown, originally the font was designed, but now it is not.
Anyone know what happen?
Without any specific error I assume browser is probably blocking files loading from mixed content, i.e. using both HTTP and HTTPS. Use your browser developer tools network tab to confirm this.
You can use // instead of http:// so that resources load from the relative protocol that the page content is loading from; Can I change all my http:// links to just //?
Also read; How to fix a website with blocked mixed content

CSS on HTTPS link in google chrome not applying proeprly

CSS on a page secured with SSL (HTTPS) not applying properly.
Its working fine on Mozilla and internet explorer but not working fine on chrome.
I tried to call external css file using java-script based on protocol, but no success.
The problem is that when accessing your CSS file over HTTPS, you are redirected to the HTTP version, and so the browser will block the file as it is not served sercurely.
You need to make sure you do not redirect back to HTTP for static resources.
Go to your config file in the web directory and change
define('HTTP_SERVER', 'http://myweb.com'),
define('HTTP_CATALOG, 'http://myweb.com');
to: https://myweb.com

Resources