-1

I have a few raspberry pis running some services in my homelab. For some reason I can't explain, they are all redirecting http to https for most servers: For example, if I run

$ curl http://example.ca 

I get the response, <html><body><script>window.location.replace("https://example.ca")</script></body></html>

And this happens for most addresses, unless the domains are well-known. Like, example.com will load properly.

Any idea why this is happening, or how I can debug the situation?

If I run curl -v, it gives a bit more indication:

< HTTP/1.1 200 Ok < Server: micro_httpd < Cache-Control: no-cache < Date: Thu, 07 Aug 2025 17:53:09 GMT < Content-Type: text/html < X-Frame-Options: SAMEORIGIN < Connection: close < 

1 Answer 1

0

micro_httpd does not have HTTPS support.

Sounds like you are running micro_httpd in conjunction with stunnel. From the man page for micro_httpd:

Note that you can use micro_httpd to serve HTTPS, if you like, by running it from stunnel. First fetch and install stunnel - FreeBSD users can just go to /usr/ports/security/stunnel and do a "make cert ; make install". Then as root run: stunnel -p /usr/local/certs/stunnel.pem -d 443 \ -l /usr/local/sbin/micro_httpd -- \ micro_httpd dir Make sure the paths to the certificate and executable are correct, and again don't forget to change "dir" to the directory you want to serve. 

If you don't what the HTTPS redirection, don't use stunnel to invoke micro_httpd.

You might find this useful, How to use stunnel as a HTTPS to HTTPS reverse proxy

1
  • This also might be useful in providing an insight as to what is happening in your setup, using micro_hhtp for HTTPS without stunnel: Libmicrohttpd and ssl Commented Aug 8 at 1:38

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.