# Implement auto-redirection to /admin

**URL:** <https://discourse.pi-hole.net/t/implement-auto-redirection-to-admin/77370>\
**Category:** Feature Requests\
**Created:** [March 2, 2025, 11:39pm UTC](https://discourse.pi-hole.net/t/implement-auto-redirection-to-admin/77370 "2025-03-02T23:39:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Santanu\_Das](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/santanu_das/32/46453_2.png) [@Santanu\_Das](https://discourse.pi-hole.net/u/Santanu_Das)\
**Post date:** [March 2, 2025, 11:39pm UTC](https://discourse.pi-hole.net/t/implement-auto-redirection-to-admin/77370/1 "2025-03-02T23:39:50Z")

</div>

I'm a new user of v6 Pi-hole and I think it should redirect to `/admin` automatically. It's really very troublesome, when behind a multi-homed Nginx (as reverse proxy). Can this be implemented please?

-S

---

<div class="post-metadata">

**Author:** ![DL6ER](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dl6er/32/281_2.png) [@DL6ER](https://discourse.pi-hole.net/u/DL6ER)\
**Post date:** [March 3, 2025, 8:27am UTC](https://discourse.pi-hole.net/t/implement-auto-redirection-to-admin/77370/2 "2025-03-03T08:27:21Z")

</div>

If your domain is what you set as `webserver.domain` in `pihole.toml` (or env vars in a docker container), we already have an automatic redirection `/` -\> `/admin/`, however, if your domain is different, we _intentionally_ don't do this.  
The reason is that some users use `IP` blocking mode which replies to your clients with the IP address of your Pi-hole when a page is blocked. If the auto-redirect would fire here, too, you'd see your Pi-hole's dashboard (or the login page if you have a password) in many places on websites where you'd normally have seen the ads. This doesn't seem desired behavior.

But maybe this is an issue with your reverse proxy, please tell us more about your particular configuration:

- Have you tried setting `webserver.domain` ?
- Are you hosting Pi-hole's dashboard on an IP address, a subdomain or maybe a path?
- ... (more interesting points about your reverse proxy setup)

---

<div class="post-metadata">

**Author:** ![Santanu\_Das](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/santanu_das/32/46453_2.png) [@Santanu\_Das](https://discourse.pi-hole.net/u/Santanu_Das)\
**Post date:** [March 3, 2025, 4:25pm UTC](https://discourse.pi-hole.net/t/implement-auto-redirection-to-admin/77370/3 "2025-03-03T16:25:10Z")

</div>

> [@DL6ER](#):
>
> - Have you tried setting `webserver.domain` ?
> - Are you hosting Pi-hole's dashboard on an IP address, a subdomain or maybe a path?

I have three options here:

1. use: `pihole.example.net`
2. use: `www.example.net/pihole`
3. Don't use any hostname assigned to pihole, let Nginx handle it

At this moment, I left the original `pi.hole` as the _domain_ but accessing it with `pihole.example.net` as I spent enough time to make `www.example.net/pihole` to work, because of that static path.

So, based on what you mentioned, for option #1 and #2, what will be the `host.domain` to get the auto-redirect work?

This is my current Nginx configuration, FYI.....

```auto
upstream local {
    server 127.0.0.1:8008;
}

server {
    listen 80;
    listen [::]:80;
    server_name pihole.example.net;
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl http2;
    server_name pihole.example.net;

    ## Server Logs
    access_log /var/log/nginx/pihole_access.log;
    error_log /var/log/nginx/pihole_error.log error;

    ## TLS Configuration
    ssl_certificate /etc/nginx/ssl/fullcrt.pem;
    ssl_certificate_key /etc/nginx/ssl/privkey.pem;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_session_cache shared:SSL:20m;
    ssl_session_timeout 60m;

    ## Extra Security
    add_header Strict-Transport-Security max-age=31536000;
    ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305;
    ssl_dhparam /etc/nginx/ssl/dhparam.pem;
    ssl_prefer_server_ciphers on;

    location = / {
        return 301 /admin;
    }

    location /admin/ {
        proxy_pass http://local/admin/;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    location /api/ {
        proxy_pass http://local/api/;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

```

-S

---

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [March 4, 2025, 1:29pm UTC](https://discourse.pi-hole.net/t/implement-auto-redirection-to-admin/77370/4 "2025-03-04T13:29:04Z")

</div>

> [@Santanu\_Das](#):
>
> At this moment, I left the original `pi.hole` as the _domain_ but accessing it with `pihole.example.net` as I spent enough time to make `www.example.net/pihole` to work, because of that static path.
> 
> So, based on what you mentioned, for option #1 and #2, what will be the `host.domain` to get the auto-redirect work?

Neither _domain_ nor `host.domain` are valid Pi-hole configuration options, and they don't appear in your nginx configuration either, so its unclear what you would be asking about.

Please share the output of:

```auto
sudo pihole-FTL --config webserver.domain

```

As @DL6ER has explained, automatic redirection to `/admin` works for whatever you've configured in `webserver.domain`.

---

<div class="post-metadata">

**Author:** ![Santanu\_Das](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/santanu_das/32/46453_2.png) [@Santanu\_Das](https://discourse.pi-hole.net/u/Santanu_Das)\
**Post date:** [March 5, 2025, 12:20am UTC](https://discourse.pi-hole.net/t/implement-auto-redirection-to-admin/77370/5 "2025-03-05T00:20:56Z")

</div>

> [@Bucking\_Horn](#):
>
> `pihole-FTL --config webserver.domain`

I'm very new to pi-hole so probably didn't understand what was meant by `webserver.domain` but `domain` indeed a valid configuration option.

The result of this command:

```auto
root@mgtcnrpi5:~# pihole-FTL --config webserver.domain
pi.hole

```

basically the output of this:

 ![image](https://discourse.pi-hole.net/uploads/default/original/3X/1/a/1a4e64b7b7ab58e44aee9e5279e95befa39de4d6.png)  
in `/etc/pihole/pihole.toml` in the form of `webserver.domain`, as far as I understand.

And that obviously won't appear in my Nginx config file, as that's the whole point of using a reverse proxy.  
So, for my #1 or #2 above, what gonna be my `webserver.domain` - that's what I was aklsing.

---

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [March 5, 2025, 6:49am UTC](https://discourse.pi-hole.net/t/implement-auto-redirection-to-admin/77370/6 "2025-03-05T06:49:21Z")

</div>

> [@DL6ER](#):
>
> - Have you tried setting `webserver.domain` ?

> [@Santanu\_Das](#):
>
> ```auto
> root@mgtcnrpi5:~# pihole-FTL --config webserver.domain
> pi.hole
> 
> ```

Your current `webserver.domain` value would suggest that the answer to DL6ER's question would be 'no'.

> [@Santanu\_Das](#):
>
> but `domain` indeed a valid configuration option.

As said before, there is no `domain` option in your nginx configuration, but I think that you want to set `webserver.domain` to match the value of `server_name` as appearing in it:

> [@Santanu\_Das](#):
>
> ` server_name pihole.example.net;`

---

<div class="post-metadata">

**Author:** ![system](https://discourse.pi-hole.net/uploads/default/original/3X/7/c/7c8792f649eeb921c5d2b4c41564ffa873d9a2b8.png) [@system](https://discourse.pi-hole.net/u/system)\
**Post date:** [September 1, 2025, 6:50am UTC](https://discourse.pi-hole.net/t/implement-auto-redirection-to-admin/77370/7 "2025-09-01T06:50:17Z")

</div>

Closed on September 1, 2025, 6:50am UTC

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