# How to default to /ghost (redirect)?

**URL:** <https://forum.ghost.org/t/how-to-default-to-ghost-redirect/5490>\
**Category:** Developer help\
**Created:** [February 5, 2019, 4:43pm UTC](https://forum.ghost.org/t/how-to-default-to-ghost-redirect/5490 "2019-02-05T16:43:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![safinn](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/safinn/32/2495_2.png) [@safinn](https://forum.ghost.org/u/safinn)\
**Post date:** [February 5, 2019, 4:43pm UTC](https://forum.ghost.org/t/how-to-default-to-ghost-redirect/5490/1 "2019-02-05T16:43:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dsecareanu](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/dsecareanu/32/413_2.png) [@dsecareanu](https://forum.ghost.org/u/dsecareanu)\
**Post date:** [February 5, 2019, 5:59pm UTC](https://forum.ghost.org/t/how-to-default-to-ghost-redirect/5490/2 "2019-02-05T17:59:20Z")

</div>

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/](https://docs.ghost.org/concepts/redirects/)

Nginx would look something like this:

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

```

---

<div class="post-metadata">

**Author:** ![Hannah](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/hannah/32/22_2.png) [@Hannah](https://forum.ghost.org/u/Hannah)\
**Post date:** [February 5, 2019, 7:04pm UTC](https://forum.ghost.org/t/how-to-default-to-ghost-redirect/5490/3 "2019-02-05T19:04:25Z")

</div>

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

> **[Configuration - Adapt your publication to suit your needs](https://ghost.org/docs/config/)**
>
> Find out how to configure your Ghost publication or override Ghost's default behaviour with robust config options, including mail, storage, scheduling and more!

---

<div class="post-metadata">

**Author:** ![safinn](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/safinn/32/2495_2.png) [@safinn](https://forum.ghost.org/u/safinn)\
**Post date:** [February 5, 2019, 7:16pm UTC](https://forum.ghost.org/t/how-to-default-to-ghost-redirect/5490/4 "2019-02-05T19:16:45Z")

</div>

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:

```auto
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 `/`.

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

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/b/ba9ce5100b8bb264586f4f572545596b2ce3f081.png) [@system](https://forum.ghost.org/u/system)\
**Post date:** [February 19, 2019, 7:27pm UTC](https://forum.ghost.org/t/how-to-default-to-ghost-redirect/5490/5 "2019-02-19T19:27:33Z")

</div>

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