How to default to /ghost (redirect)?


#1

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.


#2

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:

Nginx would look something like this:

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

#3

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


#4

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/"
},

closed #5

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