How to serve the .lp-files inside /admin with my own lighttpd server

Expected Behaviour:

I run a multi purpose Pi (Ubuntu 24) with a RetroPie install, a website served publicly, and among others, pihole. I have lighttpd installed anyway, so I do not need the built in server of pihole.

I would rather like to use my own webserver, which serves my website anyway. I would like to run the web interface of pihole by just adding /admin to my URL, like it was possible before.

Wanted: https://mydomain.com/admin

I can show the web Interface flawlessly by typing https://mydomain.com:4443/admin, but I just do not need the builtin server with different port.

Actual Behaviour:

I need to type: https://mydomain.com:4443/admin, what I do not want to do.

I would like to know how to serve the .lp-files inside /admin with my own lighttpd server. Is that possible? I would just need some kind of parsing / configuration hint for lighttpd ...

How to serve the .lp-files inside /admin with my own lighttpd server

You can't.

Even if you configure lighttpd to correctly serve .lp pages written in Lua, lighttpd won't be able to retrieve some information from FTL.

The new web server is Pi-hole itself (pihole-FTL).
The pages use some internal functions to retrieve information directly from FTL. There is no way to configure a different web server to do that.

You will need a reverse proxy for that.

You can search how to configure lighttpd as a reverse proxy.

Blockzitat

When I use this:


$SERVER["socket"] == ":443" {
    ssl.engine = "enable"
    ssl.pemfile = "/etc/letsencrypt/live/myhost.com/fullchain.pem"
    ssl.privkey = "/etc/letsencrypt/live/myhost.com/privkey.pem"

        $HTTP["url"] =~ "^/admin($|/)" {
        proxy.server = (
            "" => (
                (
                    "host" => "127.0.0.1",
                    "port" => "4443",
                    "ssl" => "disable"
                )
            )
        )
    }
}

I retrieve an Error 500 with no log in /var/log/lighttpd/error.log

What is wrong now?

What do you really see in the log? Please post the log contents.

2025-03-11 22:57:29: (server.c.2078) server stopped by UID = 0 PID = 1
2025-03-11 23:04:58: (server.c.1704) server started (lighttpd/1.4.69)
2025-03-11 23:06:25: (server.c.2078) server stopped by UID = 0 PID = 1
2025-03-11 23:06:27: (server.c.1704) server started (lighttpd/1.4.69)
2025-03-11 23:08:14: (server.c.2078) server stopped by UID = 0 PID = 1
2025-03-11 23:18:07: (server.c.1704) server started (lighttpd/1.4.69)
2025-03-11 23:25:34: (server.c.2078) server stopped by UID = 0 PID = 1
2025-03-11 23:25:36: (server.c.1704) server started (lighttpd/1.4.69)
2025-03-11 23:27:01: (server.c.2078) server stopped by UID = 0 PID = 1
2025-03-11 23:27:02: (server.c.1704) server started (lighttpd/1.4.69)
2025-03-11 23:30:29: (server.c.2078) server stopped by UID = 0 PID = 1
2025-03-11 23:32:47: (server.c.1704) server started (lighttpd/1.4.69)
2025-03-11 23:42:59: (server.c.2078) server stopped by UID = 0 PID = 1
2025-03-11 23:43:00: (server.c.1704) server started (lighttpd/1.4.69)
2025-03-11 23:43:37: (server.c.2078) server stopped by UID = 0 PID = 1
2025-03-11 23:43:38: (server.c.1704) server started (lighttpd/1.4.69)
2025-03-11 23:49:26: (server.c.2078) server stopped by UID = 0 PID = 1
2025-03-11 23:49:27: (server.c.1704) server started (lighttpd/1.4.69)
2025-03-11 23:50:28: (server.c.2078) server stopped by UID = 0 PID = 1
2025-03-11 23:50:29: (server.c.1704) server started (lighttpd/1.4.69)
2025-03-11 23:51:58: (server.c.2078) server stopped by UID = 0 PID = 1
2025-03-11 23:53:09: (server.c.1704) server started (lighttpd/1.4.69)
2025-03-11 23:53:59: (server.c.2078) server stopped by UID = 0 PID = 1
2025-03-11 23:54:00: (server.c.1704) server started (lighttpd/1.4.69)

I did the restarts manually!

I'll be honest... I'm not a lighttpd expert and we never used it as reverse proxy, so I don't know how your configuration should look like.

What I know is: you need to completely remove the previous configuration used by v5:

  • there is no PHP and fastcgi anymore (you can remove a few modules),
  • the log paths should probably be changed,
  • the old redirections are not needed because the new web interface uses different pages and paths.

Basically I wanted just to say "thank you" for your fast reply. I was quite content with "you can't", because the start topic is no severe problem :slight_smile:

But maybe we found something with the reverse proxy not working as expected?

Suggestion:

You can try the lighttpd website: https://www.lighttpd.net/ or https://redmine.lighttpd.net/projects/1/wiki

I had no special configuration for pihole with my lighttpd install. What is in config is needed for my website. /admin directory was served out of the box previously, just because it was placed in my web root :slight_smile:

Anyway, thank you for your replies, and I will continue with some testing as soon I find time.

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