Share link issue hosting Ghost blog under subfolder on Windows Azure
Asked Answered
S

3

8

I have set up a ghost blog via azure marketplace, which should be the equvilant of clicking deploy to azure from https://github.com/felixrieseberg/Ghost-Azure

Let's say I have it at: theblog.azurewebsites.net/

I want it to be at https://www.mycustomdomain.com/blog and I have the main site in another app service, let's say at mainsite.azurewebsites.net/ this site has mycustomdomain.com DNS all set up with a certificate.

Within this site I have the Rewrite in the web.config

<rule name="Reverse Proxy to blog" stopProcessing="true">
  <match url="^blog(.*)" />
  <action type="Rewrite" url="https://theblog.azurewebsites.net/blog/{R:1}" />
</rule>

At the moment I am trying to get this right in the staging site so I am viewing the blog at https://mainsite-staging.azurewebsites.net/blog/

The above rewrite successfully shows me the blog hosted at theblog.azurewebsites.net without changing the url in the browser. In theblog I also have websiteUrl app setting as https://www.mycustomdomain.com.au/blog so my canonical urls are correct in the blog posts.

Remaining Problems

  1. If I click on the logo in the blog the link is to https://theblog.azurewebsites.net rather than either https://mainsite-staging.azurewebsites.net/blog or https://www.mycustomdomain.com/blog
  2. The home link, even though specified in navigation settings as https://www.mycustomdomain.com/blog is linking to https://theblog.azurewebsites.net
  3. The share links for twitter and facebook are based on sharing https://theblog.azurewebsites.net

I have searched the internet for ages...

I answered: Turns out there is also a websiteUrlSSL app setting that is not mentioned on the readme.

I just needed to set this too.

Slovenia answered 17/5, 2017 at 6:8 Comment(1)
There is a siteName setting, but looks like that should be ignored if I have set websiteUrlSlovenia
S
3

Turns out there is also a websiteUrlSSL app setting that is not mentioned on the readme.

I just needed to set this too.

https://github.com/felixrieseberg/Ghost-Azure/issues/57

Slovenia answered 22/5, 2017 at 1:11 Comment(0)
C
1

In your web.config, you can try to set the your custom domain https://www.mycustomdomain.com/blog/{R:1} instead of the Azure Web App Url. Which should rewrite the URL to your custom domain and pass through the DNS server.

And the remaining issues, I think it should be related with the ghost configurations. Please double check whether you have set the correct configuration in your ghost application, as mentioned at Custom Domain Setup

Chamfer answered 19/5, 2017 at 1:29 Comment(1)
That link is for ghost pro rather than self hosted.Slovenia
B
-1

Before you read my answer

  • I set my server on apache not Azure so I'm not sure about configs in Microsoft Azure
  • You need to have the access of files of your Ghost blog site
  • My answer is about Ghost application's config not Azure system config

Answer

  1. Open the file located at /path/to/ghost/config.js with any editor you like
  2. Find the line production and under it you should have a url:http://yourdomain.com modify it to the URL you want
  3. You should ask your hosting provider in this case Azure to restart the node js application for Ghost (If you want to SSH method you can visit A2Hosting tutorial but since it's using terminal I don't use this method, if you have the command wrong it might break your server)
  4. I have look through the setting of sharing function it seems it base on post URL so if it doesn't work right after you change the config of the URL section tell me

Last I can't help you on the rewrite rule since I'm not familiar on IIS or Microsoft Azure

Blanchard answered 23/5, 2017 at 10:1 Comment(1)
I think I am supposed to downvote your answer because your not answering the question and talking about apache instead.Slovenia

© 2022 - 2024 — McMap. All rights reserved.