# Question after getting https on lighttpd

**URL:** <https://dietpi.com/forum/t/question-after-getting-https-on-lighttpd/16713>\
**Category:** General Discussion\
**Tags:** lighttpd, services, web-server\
**Created:** [27 April 2023 23:52 UTC](https://dietpi.com/forum/t/question-after-getting-https-on-lighttpd/16713 "2023-04-27T23:52:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tubz](https://dietpi.com/forum/user_avatar/dietpi.com/tubz/32/3463_2.png) [@Tubz](https://dietpi.com/forum/u/Tubz)\
**Post date:** [27 April 2023 23:52 UTC](https://dietpi.com/forum/t/question-after-getting-https-on-lighttpd/16713/1 "2023-04-27T23:52:37Z")

</div>

So the whole certificate thing worked. (Thanks joulinar.) And when searching my domain (tubzpi.xyz) it did show for a second before saying connection failed or site cannot be reached. Neither [http://tubzpi.xyz](http://tubzpi.xyz) or [https://tubzpi.xyz](https://tubzpi.xyz) work. Do I have to make a new file for https? I don’t trust other online tutorials anymore so that’s why I ask. But in short nothing shows up, and lighttpd is working well no errors nothing. Any solutions? Also I’ve made the root in the config file /var/www/tubzpi.xyz, where an index.html file is and index.css file is. Website is public so you can check if needed.  
Sorry for the many post btw.

---

<div class="post-metadata">

**Author:** ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)\
**Post date:** [28 April 2023 05:17 UTC](https://dietpi.com/forum/t/question-after-getting-https-on-lighttpd/16713/2 "2023-04-28T05:17:04Z")

</div>

What webserver do you use?  
Did you change the webroot after you created the SSL certificates?  
Maybe you can revert your change of the webroot and see if it’s working again.

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [28 April 2023 06:58 UTC](https://dietpi.com/forum/t/question-after-getting-https-on-lighttpd/16713/3 "2023-04-28T06:58:33Z")

</div>

you have set correct port forwarding for port 443 on your router?

Let’s check LISTEN ports

```auto
ss -tulpn | grep LISTEN

```

Following configuration file has been created again?

```auto
/etc/lighttpd/conf-enabled/50-dietpi-https.conf

```

@Jappe this is the related issue [Problem with lighttpd not detecting a folder that has ssl certificate inside](https://dietpi.com/forum/t/problem-with-lighttpd-not-detecting-a-folder-that-has-ssl-certificate-inside/16709)

---

<div class="post-metadata">

**Author:** ![Tubz](https://dietpi.com/forum/user_avatar/dietpi.com/tubz/32/3463_2.png) [@Tubz](https://dietpi.com/forum/u/Tubz)\
**Post date:** [28 April 2023 08:20 UTC](https://dietpi.com/forum/t/question-after-getting-https-on-lighttpd/16713/4 "2023-04-28T08:20:09Z")

</div>

Is it okay for me to paste the whole table here? or no? But from what i see, lighttpd is listening at 443 and 80. And yes the file has been made.  
(Sorry for late reply was travelling)

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [28 April 2023 08:34 UTC](https://dietpi.com/forum/t/question-after-getting-https-on-lighttpd/16713/5 "2023-04-28T08:34:40Z")

</div>

port forwarding on your router has been correctly set for port 80/443?

---

<div class="post-metadata">

**Author:** ![Tubz](https://dietpi.com/forum/user_avatar/dietpi.com/tubz/32/3463_2.png) [@Tubz](https://dietpi.com/forum/u/Tubz)\
**Post date:** [28 April 2023 08:51 UTC](https://dietpi.com/forum/t/question-after-getting-https-on-lighttpd/16713/6 "2023-04-28T08:51:09Z")

</div>

yes, ive forwardded both 80 and 443, to my pi and used TCP.

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [28 April 2023 09:10 UTC](https://dietpi.com/forum/t/question-after-getting-https-on-lighttpd/16713/7 "2023-04-28T09:10:16Z")

</div>

how does it look if you try to access your web server from inside your local network? You could check https access using DDNS as well as local IP (yes, a cert warning might be shown)

---

<div class="post-metadata">

**Author:** ![Tubz](https://dietpi.com/forum/user_avatar/dietpi.com/tubz/32/3463_2.png) [@Tubz](https://dietpi.com/forum/u/Tubz)\
**Post date:** [28 April 2023 09:22 UTC](https://dietpi.com/forum/t/question-after-getting-https-on-lighttpd/16713/8 "2023-04-28T09:22:45Z")

</div>

right now im trying to access the website from outside on a different internet, when i tested the lighttpd yesterday before running the dietpi-letsencrypt script it worked, it worked on mobile data and my friends internet as well. i dont remember if it showed up as https thou, but i do remember for a few minutes after i ran the script it worked, if it was https i dont remember as well. And to answer your question its the same answer inside my network, not accessible, on both local ip and the domain.

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [28 April 2023 09:34 UTC](https://dietpi.com/forum/t/question-after-getting-https-on-lighttpd/16713/9 "2023-04-28T09:34:54Z")

</div>

even on local IP from inside your network a connection is not possible via `https://192.x.x.x:443`

---

<div class="post-metadata">

**Author:** ![Tubz](https://dietpi.com/forum/user_avatar/dietpi.com/tubz/32/3463_2.png) [@Tubz](https://dietpi.com/forum/u/Tubz)\
**Post date:** [28 April 2023 09:36 UTC](https://dietpi.com/forum/t/question-after-getting-https-on-lighttpd/16713/10 "2023-04-28T09:36:46Z")

</div>

Yes, it cannot be reached, also im not sure if this normal but i have two lighttpd.conf files, the second one called lighttpd1.conf

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [28 April 2023 09:38 UTC](https://dietpi.com/forum/t/question-after-getting-https-on-lighttpd/16713/11 "2023-04-28T09:38:29Z")

</div>

> [@Tubz](#):
>
> lighttpd.conf files, the second one called lighttpd1.conf

this is unexpected. Can you share both?

---

<div class="post-metadata">

**Author:** ![Tubz](https://dietpi.com/forum/user_avatar/dietpi.com/tubz/32/3463_2.png) [@Tubz](https://dietpi.com/forum/u/Tubz)\
**Post date:** [28 April 2023 09:48 UTC](https://dietpi.com/forum/t/question-after-getting-https-on-lighttpd/16713/12 "2023-04-28T09:48:27Z")

</div>

lighttpd.conf

```auto
server.modules = (
"mod_access" ,
"mod_accesslog" ,
"mod_fastcgi" ,
"mod_rewrite" ,
"mod_auth"

)

server.document-root = "/var/www/tubzpi.xyz"
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

# features
#https://redmine.lighttpd.net/projects/lighttpd/wiki/Server_feature-flagsDetails
server.feature-flags += ("server.h2proto" => "enable")
server.feature-flags += ("server.h2c" => "enable")
server.feature-flags += ("server.graceful-shutdown-timeout" => 5)
#server.feature-flags += ("server.graceful-restart-bg" => "enable")

# strict parsing and normalization of URL for consistency and security
# https://redmine.lighttpd.net/projects/lighttpd/wiki/Server_http-parseoptsDetails
# (might need to explicitly set "url-path-2f-decode" = "disable"
# if a specific application is encoding URLs inside url-path)
server.http-parseopts = (
  "header-strict" => "enable",# default
  "host-strict" => "enable",# default
  "host-normalize" => "enable",# default
  "url-normalize-unreserved"=> "enable",# recommended highly
  "url-normalize-required" => "enable",# recommended
  "url-ctrls-reject" => "enable",# recommended
  "url-path-2f-decode" => "enable",# recommended highly (unless breaks app)
 #"url-path-2f-reject" => "enable",
  "url-path-dotseg-remove" => "enable",# recommended highly (unless breaks app)
 #"url-path-dotseg-reject" => "enable",
 #"url-query-20-plus" => "enable",# consistency in query string
)

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

# default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.conf.pl"
include "/etc/lighttpd/conf-enabled/*.conf"

#server.compat-module-load = "disable"
server.modules += (
        "mod_dirlisting",
        "mod_redirect",
        "mod_setenv",
        "mod_staticfile",
)

```

lighttpd1.conf

```auto
server.modules = (
"mod_access" ,
"mod_accesslog" ,
"mod_fastcgi" ,
"mod_rewrite" ,
"mod_auth"

)

server.document-root = "/var/www/tubzpi.xyz"
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

# features
#https://redmine.lighttpd.net/projects/lighttpd/wiki/Server_feature-flagsDetails
server.feature-flags += ("server.h2proto" => "enable")
server.feature-flags += ("server.h2c" => "enable")
server.feature-flags += ("server.graceful-shutdown-timeout" => 5)
#server.feature-flags += ("server.graceful-restart-bg" => "enable")
                                                                  
# strict parsing and normalization of URL for consistency and security
# https://redmine.lighttpd.net/projects/lighttpd/wiki/Server_http-parseoptsDetails
# (might need to explicitly set "url-path-2f-decode" = "disable"
# if a specific application is encoding URLs inside url-path)
server.http-parseopts = (
  "header-strict" => "enable",# default
  "host-strict" => "enable",# default
  "host-normalize" => "enable",# default
  "url-normalize-unreserved"=> "enable",# recommended highly
  "url-normalize-required" => "enable",# recommended
  "url-ctrls-reject" => "enable",# recommended
  "url-path-2f-decode" => "enable",# recommended highly (unless breaks app)
 #"url-path-2f-reject" => "enable",
  "url-path-dotseg-remove" => "enable",# recommended highly (unless breaks app)
 #"url-path-dotseg-reject" => "enable",
 #"url-query-20-plus" => "enable",# consistency in query string
)

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

# default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.conf.pl"
include "/etc/lighttpd/conf-enabled/*.conf"

#server.compat-module-load = "disable"
server.modules += (
        "mod_dirlisting",
        "mod_staticfile",
)

```

@Joulinar

---

<div class="post-metadata">

**Author:** ![Tubz](https://dietpi.com/forum/user_avatar/dietpi.com/tubz/32/3463_2.png) [@Tubz](https://dietpi.com/forum/u/Tubz)\
**Post date:** [28 April 2023 12:30 UTC](https://dietpi.com/forum/t/question-after-getting-https-on-lighttpd/16713/14 "2023-04-28T12:30:29Z")

</div>

You answered a similar thing here, where the persons https wasnt working, shoud i follow those steps from where i am

> [@Trouble enabling Https:// with Let's Encrypt on lighttpd](https://dietpi.com/forum/t/trouble-enabling-https-with-lets-encrypt-on-lighttpd/4176):
>
> Apologies in advance for being stupid. Very inexperienced here. I have lighttpd running with a no-ip address on http just fine (RPi4). I ran dietpi-letsencrypt, punched in my domain info and such and got a success. I edited my lightpttd .conf file to include $HTTP["host"] =~ ".\*" { url.redirect = (".\*" =\> "https://%0$0") Then rebooted. Still no change in https. Surely I’m missing some obvious step.

---

<div class="post-metadata">

**Author:** ![Tubz](https://dietpi.com/forum/user_avatar/dietpi.com/tubz/32/3463_2.png) [@Tubz](https://dietpi.com/forum/u/Tubz)\
**Post date:** [28 April 2023 13:33 UTC](https://dietpi.com/forum/t/question-after-getting-https-on-lighttpd/16713/15 "2023-04-28T13:33:13Z")

</div>

nvm this did not work, any other suggestions.

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [3 May 2023 06:54 UTC](https://dietpi.com/forum/t/question-after-getting-https-on-lighttpd/16713/16 "2023-05-03T06:54:53Z")

</div>

sorry for the late response but I was out for a couple of days and missed to answer. What is current status of your system?

---

<div class="post-metadata">

**Author:** ![Tubz](https://dietpi.com/forum/user_avatar/dietpi.com/tubz/32/3463_2.png) [@Tubz](https://dietpi.com/forum/u/Tubz)\
**Post date:** [3 May 2023 07:05 UTC](https://dietpi.com/forum/t/question-after-getting-https-on-lighttpd/16713/17 "2023-05-03T07:05:03Z")

</div>

Still doesn’t work, there’s this problem and the other problem with the ufw. Is it okay if we fix the ufw first then go on to this as that’s more recent?

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [3 May 2023 08:12 UTC](https://dietpi.com/forum/t/question-after-getting-https-on-lighttpd/16713/18 "2023-05-03T08:12:12Z")

</div>

> [@Tubz](#):
>
> Is it okay if we fix the ufw first then go on to this as that’s more recent?

ok let’s do it this way.

---

<div class="post-metadata">

**Author:** ![Tubz](https://dietpi.com/forum/user_avatar/dietpi.com/tubz/32/3463_2.png) [@Tubz](https://dietpi.com/forum/u/Tubz)\
**Post date:** [3 May 2023 21:52 UTC](https://dietpi.com/forum/t/question-after-getting-https-on-lighttpd/16713/19 "2023-05-03T21:52:10Z")

</div>

@Joulinar im an idiot i just realised I configured port forwarding wrong on my router, instead of doing 443 I did 433. that was the biggest facepalm I gave myself flip sake. thanks anyways.

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [3 May 2023 22:15 UTC](https://dietpi.com/forum/t/question-after-getting-https-on-lighttpd/16713/20 "2023-05-03T22:15:29Z")

</div>

At least you found it 😉

---

<div class="post-metadata">

**Author:** ![Tubz](https://dietpi.com/forum/user_avatar/dietpi.com/tubz/32/3463_2.png) [@Tubz](https://dietpi.com/forum/u/Tubz)\
**Post date:** [3 May 2023 22:35 UTC](https://dietpi.com/forum/t/question-after-getting-https-on-lighttpd/16713/21 "2023-05-03T22:35:04Z")

</div>

Well, I guess I wiped Lighttpd for no reason, but configuring Apache was actually way easier, I just did Certbot --apache and It configured everything.

[Next page](https://dietpi.com/forum/t/question-after-getting-https-on-lighttpd/16713.md?page=2)
