You deploy ghost CMS with bitnami on google cloud. First, make sure you disable page speed in ghost cms—page speed help to convert your images into webp format to improve web speed in the browser.
For converting images into webp format, the image URL starts the break. You face an issue. Some of the pictures do not load, and you debug the problem. You find mod_pagespeed
is rewriting the image URL, your image URL is broken, and your image does not load.
https://officialrajdeepsingh.dev/content/images/2021/02/xmkdir--mflag.png.pagespeed.ic.05T5AX_xYP.webp
Ghost already load different image sizes according to display. All image breakpoint config in the side ghost CMS. that reason mod_pagespeed
does not work correctly in ghost CMS.
There is only one way to solve it. That is disabled page speed by default configuration in apache.
Steps
In the first step, You open the ssh terminal in your instance. For example purposes, I'm using a google cloud inbuilt SSH terminal.
In google > Deployment manager > Select ghost installation instance > Click open SSH terminal
In the second step, you log in with a bitnami user to easily edit and update the files in-app.
sudo su bitnami
In the last step, you edit a file httpd.conf file in your apache configuration.
You edit httpd.conf file with nano and vim editor. For example, I use a nano text editor.
nano /opt/bitnami/apache2/conf/httpd.conf
The open file looks like a terminal with a nano text editor. You find two lines of code with include page speed statement in httpd.conf file.
Include conf/pagespeed.conf
Include conf/pagespeed_libraries.conf
You comment two lines in httpd.conf file. For commenting, you add a # hash symbol on the beginning line.
#Include conf/pagespeed.conf
#Include conf/pagespeed_libraries.conf
How to save files in nano editor?
After successfully comment two-line of the code and now restarting the apache.
sudo /opt/bitnami/ctlscript.sh restart apache
All the images per cache all image locally and rewrite URL. If you do not remove the cache, your website does not work correctly—so clear cache in apache.
sudo touch /opt/bitnami/apache2/var/cache/mod_pagespeed/cache.flush
After successfully pagespeed cache in apache, now more time to restart apache again.
sudo /opt/bitnami/ctlscript.sh restart apache
Now your website is ready to use. You do not see any broken image URL on your website.
https://forum.ghost.org/t/image-url-broken/29007
I'm a big thank Martin Webster on the ghost forum to guide me in removing broken image URLs on the ghost CMS website.