Writing About Configuring Ghost Admin to use HTTPS with nginx
I’m considering migrating from Wordpress to Ghost so have them running side by side for a bit:
- http://oftheoldschool.com (Wordpress)
- http://andy.stanton.is/writing/ (Ghost)
Ghost does not have good media support at the moment so although I imported from Wordpress the images are broken. So is anything that used a Wordpress shortcode e.g. Soundcloud, Youtube etc.
Though that stands against it, I’ve not got that many posts so fixing those problems is doable. The ability to write posts in markdown is a big win for Ghost.
SSL for Ghost Admin ONLY
As with Wordpress, I want my admin area to be served using a self-signed certificate but I don’t want any of the rest of the blog available over https.
Ghost have provided an example nginx configuration to serve the entirety of the site over http and https. In addition, a Ghost config option allows you to force the admin page over https. The instructions for achieving this can be found here.
However, the rest of the blog will still be available over https too which is undesirable with a self-signed certificate. I don’t want the possibility of links to my site coming up with the ‘The site’s security certificate is not trusted!’ warning.
With a bit of crafty nginx configuration, we can make sure that only requests to /ghost
are redirected to https, while any other requests are redirected to http.
This example server configuration shows how to achieve this: