Ghost 3 upgrade breaks reverse proxy 'health check'

I have two instances of Ghost running on the same Ubuntu server, and front-end these instances with HAproxy running on a separate cluster, which has worked for years. These instances are listening one on port 443 and the other on 444.

I’m in the process of upgrading to Ghost 3.0.2 from 2.37.0, and when I do upgrade an instance it breaks the reverse proxy health check function, causing it to fail over to a maintenance page indicating the blog is down, even though Ghost has upgraded perfectly, and works when accessed directly. Access via the reverse proxy, which sends traffic from the Internet can only be restored by turning off health checking.

HAproxy uses near identical backend server configurations for both instances, with the only difference being port 443/444. It doesn’t matter which instance is upgraded, but after the upgrade the 3.0.2 instance fails and needs me to restore from snapshot backup

Looking at the Ghost blog access log indicates that the test URL is returning a 404 error.

[2019-11-11 03:07:25] INFO “HEAD /test/” 404 0ms

Accessing this same page directly works just fine.

[2019-11-11 14:51:41] INFO “GET /test/” 200 57ms
[2019-11-11 14:51:41] INFO “GET /assets/built/screen.css?v=f3e833025f” 200 5ms
[2019-11-11 14:51:41] INFO “GET /assets/built/jquery.fitvids.js?v=f3e833025f” 200 3ms

There are no errors logged in the Ghost error log

HAproxy back-end configuration:

backend bk_ghost_https
option forwardfor
timeout client 10s
timeout server 10s
option httpchk HEAD /test/
http-check expect status 200
server ghost ssl verify none maxconn 1000 check inter 1000
server itbroke ssl verify none maxconn 1000 backup

Is this a bug, or has the way that health checks should be performed with a reverse proxy changed?

Thanks in advance for any help/suggestions.

It would appear that Ghost 3 gets grumpy that the health check request used by HAproxy does not include ‘host’ information.

Adding this information to the check request like the following makes it work for Ghost 3.x, and also earlier versions.

option httpchk HEAD /test/ HTTP/1.0\r\nHost:\

This was driving me nuts.

Thanks to those who took a look, and hopefully this will help someone else in future.