Ghost redirecting to login page using haproxy


I am trying to setup a ghost installation with haproxy in front instead of nginx. Everything works however when I try to login I am getting redirrected back to the login page of the ghost installation.

  • The url is

  • Using the latest version of ghost

  • There are two servers serving content via a public facing haproxy which has the two ghost nodes as a backend.

  • I am using the latest version of safari

  • the Errors I can see in the console are the following:

NAME: UnauthorizedError
MESSAGE: Access denied.


Client credentials were not provided
For information on how to fix this, please read
UnauthorizedError: Access denied.
    at new UnauthorizedError (/var/www/ghost/versions/1.22.6/node_modules/ghost-ignition/lib/errors/index.js:101:23)
    at authenticateClient (/var/www/ghost/versions/1.22.6/core/server/services/auth/authenticate.js:40:25)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/1.22.6/node_modules/express/lib/router/layer.js:95:5)
    at next (/var/www/ghost/versions/1.22.6/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/var/www/ghost/versions/1.22.6/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/1.22.6/node_modules/express/lib/router/layer.js:95:5)
    at /var/www/ghost/versions/1.22.6/node_modules/express/lib/router/index.js:281:22
    at param (/var/www/ghost/versions/1.22.6/node_modules/express/lib/router/index.js:354:14)
    at param (/var/www/ghost/versions/1.22.6/node_modules/express/lib/router/index.js:365:14)
    at Function.process_params (/var/www/ghost/versions/1.22.6/node_modules/express/lib/router/index.js:410:3)
    at next (/var/www/ghost/versions/1.22.6/node_modules/express/lib/router/index.js:275:10)
    at Function.handle (/var/www/ghost/versions/1.22.6/node_modules/express/lib/router/index.js:174:3)
    at router (/var/www/ghost/versions/1.22.6/node_modules/express/lib/router/index.js:47:12)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/1.22.6/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/1.22.6/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/1.22.6/node_modules/express/lib/router/index.js:284:7
  • have a production ghost installed as a backend for haproxy.

Update: I have tried to connect using firefox and the redirrect is not there. I can login correctly using it.

This won’t work well, we warn against clustered/load-balanced setups in the docs. There’s some more details in this topic and a wishlist topic for adding an internal cache adapter which would open up cluster support by externalising the current in-memory caches.

I would suggest using a single instance of Ghost and testing without haproxy. If that works then add the haproxy back in and test again.

Sharing your haproxy config will also help anyone spot any problems. The login issue isn’t reproducible with Safari on standard installs with nginx as the reverse proxy so it sounds like something unique to your environment.

I have come to the conclusion that the issue is due to safari. If I browse it using firefox then it works perfectly.


@zozo did you see this part of my reply?

If you don’t want to dig into it further and are happy to use a browser that’s working for your setup then :+1: I wouldn’t say that this is a bug in Ghost however as it’s not reproducible with the standard setups.

I am happy with using a different browser. However I think I’ve seen the same issue logged about 5-6 days a go for internet explorer and safari. Thanks anyway

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.