How to default to /ghost (redirect)?

I have Ghost installed on a VPS and I only want to use the admin panel.
What is the best way to forward my domain (admin.domain.com) to go to the admin panel?

Would it be through DNS or Nginx?

Ghost was installed using the CLI with the url set to admin.domain.com

Thank you.

Most probably your nginx site config should be able to do the trick, but you can also do it through DNS and also through the Ghost redirects:
https://docs.ghost.org/concepts/redirects/

Nginx would look something like this:

location ~ ^/(.*) {
    return 301 /ghost/;
}

You can set your domain as the admin URL and set something else as the main URL.

Thank you for the reply. Tried the Nginx method as I’d like to get better with Nginx. I added it to the ssl config under the already present location / so it looked something like this:

location / {
    ...
    proxy_pass http://127.0.0.1:2368;
}

location ~ ^/(.*) {
    return 301 /ghost/;
}

but It seems I end up in a loop of trying to load /ghost and then fails.

I tried setting the admin url in the ghost config but now it 404’s and cannot find /.

"url": "https://admin.domain.com/blog",
"admin": {
    "url": "https://admin.domain.com/"
},

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