# Setup lighttpd reverse proxy for v6

**URL:** <https://discourse.pi-hole.net/t/setup-lighttpd-reverse-proxy-for-v6/78633>\
**Category:** Community Help\
**Created:** [March 30, 2025, 5:16pm UTC](https://discourse.pi-hole.net/t/setup-lighttpd-reverse-proxy-for-v6/78633 "2025-03-30T17:16:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![fozid](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/f/e9a140/32.png) [@fozid](https://discourse.pi-hole.net/u/fozid)\
**Post date:** [March 30, 2025, 5:16pm UTC](https://discourse.pi-hole.net/t/setup-lighttpd-reverse-proxy-for-v6/78633/1 "2025-03-30T17:16:38Z")

</div>

#### Please follow the below template, it will help us to help you!

### _If you are Experiencing issues with a Pi-hole install that has non-standard elements (e.g you are using `nginx` instead of `lighttpd`, or there is some other aspect of your install that is customised) - please use the [Community Help](https://discourse.pi-hole.net/c/bugs-problems-issues/community-help/36) category._

## Expected Behaviour:

Raspberry pi 4 4gb  
64 bit Raspberry pi os lite (bookworm)  
Original v5 install, upgraded with pihole up to V6  
Running lighttpd as my web server managing SSL  
Pihole on port 8080, local IP 192.168.1.2

How do I setup reverse proxy from mydomain.com using /pihole to access the web UI whilst retaining access to my homepage at mydomain.com?

Every config option I try either the login page hangs, or if I get to the webui, the data elements fail to load. Errors in the console complain about /api/ end point, but I can't get the proxy settings right to work with it.

## Actual Behaviour:

Doesn't work

## Debug Token:

[https://tricorder.pi-hole.net/kDmD34qb/](https://tricorder.pi-hole.net/kDmD34qb/)

---

<div class="post-metadata">

**Author:** ![rdwebdesign](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/rdwebdesign/32/51363_2.png) [@rdwebdesign](https://discourse.pi-hole.net/u/rdwebdesign)\
**Post date:** [March 30, 2025, 9:22pm UTC](https://discourse.pi-hole.net/t/setup-lighttpd-reverse-proxy-for-v6/78633/3 "2025-03-30T21:22:54Z")

</div>

@TheME

If I remember correctly you said you are using `lighttpd` as reverse proxy.

Can you please explain how you did it, or suggest a tutorial?

---

<div class="post-metadata">

**Author:** ![fozid](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/f/e9a140/32.png) [@fozid](https://discourse.pi-hole.net/u/fozid)\
**Post date:** [March 31, 2025, 9:16am UTC](https://discourse.pi-hole.net/t/setup-lighttpd-reverse-proxy-for-v6/78633/4 "2025-03-31T09:16:36Z")

</div>

Not sure what you mean sorry? You mean you have no idea how to use lighttpd web server as a reverse proxy? I just used google to figure it out.  
My config for pihole v5 is

```auto
$HTTP["url"] =~ "^/pihole2/" {
proxy.header = ("map-urlpath" => ( "/pihole2/" => "/admin/" ))
proxy.server = ( "" => ( ( "host" => "192.168.1.4", "port" => 80 ) ) )
}

```

---

<div class="post-metadata">

**Author:** ![fozid](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/f/e9a140/32.png) [@fozid](https://discourse.pi-hole.net/u/fozid)\
**Post date:** [March 31, 2025, 3:02pm UTC](https://discourse.pi-hole.net/t/setup-lighttpd-reverse-proxy-for-v6/78633/5 "2025-03-31T15:02:11Z")

</div>

After spending hours chatting to github ai, I have solved it. For anybody else, here is my config. The parts I think are important anyway;

Place this at the start of all your services under the same domain

```auto
$HTTP["host"] =~ "mydomain.com" {

```

and then for the pihole reverse proxy

```auto
    url.rewrite-once = (
        "^/pihole/admin(/.*)?$" => "/admin$1",
        "^/pihole/api(/.*)?$" => "/api$1"
    )

    # Reverse proxy for Pi-hole admin interface
    proxy.server = (
        "/admin" => (
            (
                "host" => "192.168.1.2",
                "port" => 8080
            )
        ),
        "/api" => (
            (
                "host" => "192.168.1.2",
                "port" => 8080
            )
        )
    )

    # Add X-Forwarded-Prefix header for Pi-hole
    $HTTP["url"] =~ "^/pihole" {
        setenv.add-request-header = (
            "X-Forwarded-Prefix" => "/pihole"
        )
    }
}

```

---

<div class="post-metadata">

**Author:** ![TheME](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/theme/32/42277_2.png) [@TheME](https://discourse.pi-hole.net/u/TheME)\
**Post date:** [March 31, 2025, 4:58pm UTC](https://discourse.pi-hole.net/t/setup-lighttpd-reverse-proxy-for-v6/78633/6 "2025-03-31T16:58:58Z")

</div>

Good to hear that you figured it out alredy, as my config is different because I have set up `lighttpd` to expose each service to another subdomain.

> [@fozid](#):
>
> For anybody else, here is my config.

Did you also need to configure the `webserver.paths.prefix` setting?

 ![image](https://discourse-cdn.pi-hole.net/uploads/default/original/3X/b/8/b858395180571d927880b17fa5ab81ef583b1f78.png)

---

<div class="post-metadata">

**Author:** ![fozid](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/f/e9a140/32.png) [@fozid](https://discourse.pi-hole.net/u/fozid)\
**Post date:** [March 31, 2025, 8:14pm UTC](https://discourse.pi-hole.net/t/setup-lighttpd-reverse-proxy-for-v6/78633/7 "2025-03-31T20:14:18Z")

</div>

No, I haven't had to touch `webserver.paths.prefix` yet. Although I only have 1 server with pihole upgraded to V6 so far. My second server with pihole is still v5. That's on 192.168.1.4. Will need some time spare to work through whether this current proxy config will be sufficient to manage both servers.

It's that option in the webui? Or just in the pihole toml file?

---

<div class="post-metadata">

**Author:** ![TheME](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/theme/32/42277_2.png) [@TheME](https://discourse.pi-hole.net/u/TheME)\
**Post date:** [March 31, 2025, 9:21pm UTC](https://discourse.pi-hole.net/t/setup-lighttpd-reverse-proxy-for-v6/78633/8 "2025-03-31T21:21:51Z")

</div>

It is a bit hidden in the WebUI.

You find it by

1. Go to a settings page site and toggle the switch on the top right from `Basic` to `Expert`.
2. You'll now find `All settings` in the left menu pane.
3. On the `All settings` page, switch over to the `Webserver and API` tab to find the `webserver.paths.prefix` option.

But you can also change this setting from the CLI with

```
sudo pihole-FTL --config webserver.paths.prefix "<value>"
```

---

<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:** [April 21, 2025, 9:21pm UTC](https://discourse.pi-hole.net/t/setup-lighttpd-reverse-proxy-for-v6/78633/9 "2025-04-21T21:21:55Z")

</div>

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