I've finally succeeded in moving our blog to the main domain, which is better for SEO.
We used to have cloud hosting of our Img.vision blog the "Img Handbook".
The last day of 2019 I tried to move the subdomain to the main domain for the SEO benefits it has. I failed back then.
But now I succeeded! 💪
We are using Cloudflare Workers as a Reverse Proxy & a Digital Ocean droplet of just $5.
Here's the detailed journey:
www.img.vision/handbook/
For anyone reaching this post - I've now also set up Ghost like this, and as a celebration of doing so, wrote a full guide: https://cloak.ist/blog/how-to-put-a-ghost-blog-at-a-subdirectory-using-cloudflare-workers/
Hi Mathias, I'm really struggling to do this. Do you have any more tips?
So far:
Any more tips greatly appreciated! Really want to get this working.
OK @mathias458, actually I finally figured out how to do this. Really interested in this step of yours though:
Restricted direct access to droplet to Cloudflare, updown and me
How did you do that?
Update: I did this using a Cloudflare Firewall rule with URI Full contains 'ghost.cloak.ist'. So I think I've finally got my dream blog set up.
Hey, nice to see someone try out the steps I did.
Check out this article regarding limiting access: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-18-04
Hey @Mathias458, @louisbarclay
I followed both of your guides. My main website (polymersearch.com) is pointed at some page builder. I want to have polymersearch.com/blog serving the ghost blog, hosted on DO.
I've set-up the blog at blog.polymersearch.com/blog and CloudFlare workers as reverse proxy.
However I'm still not being able to access the ghost blog on polymersearch.com/blog
Hi @ribice
Here are the steps:
Setup ghost blog on alternativeDomain.com or alternativeSubdomain.domain.com
Add Cloudflare Worker script (provided below)
Change your ghost installation url using cli to where you want to show it, example:
ghost config url https://preferredSite.com/blog/
Then restart ghost
https://preferredSite.com/blog/* -> to your cloudflare worker script
Make sure the domain preferredSite.com is "orange" on the DNS tab, so proxied by Cloudflare, so that Cloudflare can manipulate the traffic.
Here is the Edge worker script, replace "alternativeDomain.com" & "preferredSite.com":
----
Disclaimer: Using this config your ghost is proxied to a path, but I didn't succeed in getting the members functionality to work. The Send Magic Link fails with 400 Bad Request. This means no visitors can subscribe or login, admin panel is not affected.
I tested thoroughly and found this reverse proxy is the reason Send Magic Link doesn't work, it works fine before/while not reverse proxying.
If someone can solve this, let me know.
Hey @ribice, sorry about that. Feel free to email me (find email on my profile) and I'll happily help you out. Quite confused about why this would be the case - is the route for your Cloudflare worker definitely correct? Also - is there any Page Rule that could be overriding the worker route? Let's discuss over email!
Hey @louisbarclay I provided exact steps I use above.
Did you manage to solve members signup/login?
No email sent trying to sign up as a visitor.
Those that are interested in doing a Reverse Proxy with Cloudflare Workers, check out this open source code: https://github.com/Berkeley-Reject/Workers-Proxy
I see the url is gone now, I provided script above.