# Enabling HTTPS for web interface on Pi hole fails

**URL:** <https://discourse.pi-hole.net/t/enabling-https-for-web-interface-on-pi-hole-fails/51635>\
**Category:** Community Help\
**Created:** [December 15, 2021, 6:02pm UTC](https://discourse.pi-hole.net/t/enabling-https-for-web-interface-on-pi-hole-fails/51635 "2021-12-15T18:02:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xalio](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/xalio/32/21079_2.png) [@Xalio](https://discourse.pi-hole.net/u/Xalio)\
**Post date:** [December 15, 2021, 6:02pm UTC](https://discourse.pi-hole.net/t/enabling-https-for-web-interface-on-pi-hole-fails/51635/1 "2021-12-15T18:02:37Z")

</div>

Hi guys,

I've been following the following article (and few others) to enable HTTPS on Pi-hole (which I've done in the past successfully) but I struggle... [Enabling HTTPS for your Pi-hole Web Interface](https://discourse.pi-hole.net/t/enabling-https-for-your-pi-hole-web-interface/5771)

Could you please give me some hints on this?

Here is my config of the Lighttpd.conf and external.conf files:

lighttpd.conf

```auto
# Pi-hole: A black hole for Internet advertisements
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# Lighttpd config for Pi-hole
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.

###############################################################################
# FILE AUTOMATICALLY OVERWRITTEN BY PI-HOLE INSTALL/UPDATE PROCEDURE. #
# ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE #
# #
# CHANGES SHOULD BE MADE IN A SEPARATE CONFIG FILE: #
# /etc/lighttpd/external.conf #
###############################################################################

server.modules = (
    "mod_access",
    "mod_accesslog",
    "mod_auth",
    "mod_expire",
    "mod_redirect",
    "mod_setenv",
    "mod_rewrite",
    "mod_openssl"
)

server.document-root = "/var/www/html"
server.error-handler-404 = "/pihole/index.php"
#server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
server.errorlog = "/var/log/lighttpd/error.log"
server.pid-file = "/run/lighttpd.pid"
server.username = "www-data"
server.groupname = "www-data"
server.port = 80
accesslog.filename = "/var/log/lighttpd/access.log"
accesslog.format = "%{%s}t|%V|%r|%s|%b"

index-file.names = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny = ( "~", ".inc", ".md", ".yml", ".ini" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

mimetype.assign = (
    ".ico" => "image/x-icon",
    ".jpeg" => "image/jpeg",
    ".jpg" => "image/jpeg",
    ".png" => "image/png",
    ".svg" => "image/svg+xml",
    ".css" => "text/css; charset=utf-8",
    ".html" => "text/html; charset=utf-8",
    ".js" => "text/javascript; charset=utf-8",
    ".json" => "application/json; charset=utf-8",
    ".map" => "application/json; charset=utf-8",
    ".txt" => "text/plain; charset=utf-8",
    ".eot" => "application/vnd.ms-fontobject",
    ".otf" => "font/otf",
    ".ttc" => "font/collection",
    ".ttf" => "font/ttf",
    ".woff" => "font/woff",
    ".woff2" => "font/woff2"
)

# Add user chosen options held in external file
# This uses include_shell instead of an include wildcard for compatibility
include_shell "cat external.conf 2>/dev/null"

# default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port

# Prevent Lighttpd from enabling Let's Encrypt SSL for every blocked domain
#include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
include_shell "find /etc/lighttpd/conf-enabled -name '*.conf' -a ! -name 'letsencrypt.conf' -printf 'include \"%p\"\n' 2>/dev/null"

# If the URL starts with /admin, it is the Web interface
$HTTP["url"] =~ "^/admin/" {
    # Create a response header for debugging using curl -I
    setenv.add-response-header = (
        "X-Pi-hole" => "The Pi-hole Web interface is working!",
        "X-Frame-Options" => "DENY"
    )
}

# Block . files from being served, such as .git, .github, .gitignore
$HTTP["url"] =~ "^/admin/\.(.*)" {
    url.access-deny = ("")
}

# allow teleporter iframe on settings page
$HTTP["url"] =~ "/teleporter\.php$" {
    $HTTP["referer"] =~ "/admin/settings\.php" {
        setenv.add-response-header = ( "X-Frame-Options" => "SAMEORIGIN" )
    }
}

# Default expire header
expire.url = ( "" => "access plus 0 seconds" )

```

external.conf

```auto
$HTTP["host"] == "pihole.domain.tld" {
  # Ensure the Pi-hole Block Page knows that this is not a blocked domain
  setenv.add-environment = ("fqdn" => "true")

  # Enable the SSL engine with a LE cert, only for this specific host
  $SERVER["socket"] == ":4443" {
    ssl.engine = "enable"
    ssl.pemfile = "/etc/letsencrypt/live/pihole.domain.tld/web.pem"
    ssl.ca-file = "/etc/letsencrypt/live/pihole.domain.tld/fullchain.pem"
    ssl.honor-cipher-order = "enable"
    ssl.cipher-list = "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"
    ssl.use-sslv2 = "disable"
    ssl.use-sslv3 = "disable"       
  }

  # Redirect HTTP to HTTPS
  $HTTP["scheme"] == "http" {
    $HTTP["host"] =~ ".*" {
      url.redirect = (".*" => "https://%0$0")
    }
  }
}

```

When I restart the service I get:

```auto
2021-12-15 18:43:05: configfile.c.2274) server.upload-dirs doesn't exist: /var/cache/lighttpd/uploads
2021-12-15 18:43:05: plugin.c.195) dlopen() failed for: /usr/lib/lighttpd/mod_openssl.so /usr/lib/lighttpd/mod_openssl.so: cannot open shared object file: No such file or directory
2021-12-15 18:43:05: server.c.1238) loading plugins finally failed

```

I'm running Debian 11 on a Raspberry 2B here.  
I can generate the debug logs for Pihole if it's useful.

Thanks!

---

<div class="post-metadata">

**Author:** ![ShrewdGreyhound](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@ShrewdGreyhound](https://discourse.pi-hole.net/u/ShrewdGreyhound)\
**Post date:** [December 20, 2021, 9:48am UTC](https://discourse.pi-hole.net/t/enabling-https-for-web-interface-on-pi-hole-fails/51635/2 "2021-12-20T09:48:05Z")

</div>

Hey mate, I am wholly incapable of assisting you but the team will probably need your Pihole version at a minimum and/or the debug log if you want them to be able to help you

---

<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:** [January 10, 2022, 9:48am UTC](https://discourse.pi-hole.net/t/enabling-https-for-web-interface-on-pi-hole-fails/51635/3 "2022-01-10T09:48:37Z")

</div>

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