Project

General

Profile

Issue redirecting HTTPS addresses to local server address

Added by cthompto over 5 years ago

My Setup:

I am running lighttpd on a Raspberry Pi Zero W with the Raspbian Stretch Lite distro.

I am running lighttpd as part of a subnodes install: https://github.com/chootka/subnodes-lighttpd

My Goal:

To all have all urls be redirected to a local page, example:

https://www.cnn.com would redirect to http://raspberrypi.local/

This server will be very low traffic will only be hosting two pages, the landing page I want to direct to and one other.

My Settings:

$HTTP["host"] != "raspberrypi.local" {
url.redirect = (
"^/(.*)$" => "http://raspberrypi.local/"
)
}

My Issue:

Currently, redirects are only working on HTTP requests and not HTTPS request and I am unsure how that works. I have checked the forums and read the redirect rewrite up I can't seem to figure out how to get this to function. Thank you in advanced for any help or guidance.


Replies (6)

RE: Issue redirecting HTTPS addresses to local server address - Added by avij over 5 years ago

Most modern web browsers will notice that the certificate you present to the user does not belong to www.cnn.com, and refuse to proceed further.

RE: Issue redirecting HTTPS addresses to local server address - Added by cthompto over 5 years ago

avij wrote:

Most modern web browsers will notice that the certificate you present to the user does not belong to www.cnn.com, and refuse to proceed further.

Thank you for your response. So if I am trying to create a Captive Portal this is probably not the right methodology?

RE: Issue redirecting HTTPS addresses to local server address - Added by avij over 5 years ago

Your configuration seems to be correct, but it's the browsers that are the problem here and I'm afraid you can't do anything about the issue.

RE: Issue redirecting HTTPS addresses to local server address - Added by avij over 5 years ago

On the other hand, if your clients can access https sites without going through your portal (and you want to prevent this), this is a configuration problem within your firewall/router and not a lighttpd problem.

RE: Issue redirecting HTTPS addresses to local server address - Added by cthompto over 5 years ago

The end goal, is to have a network that people logon to and are redirected to my locally hosted site. The page is part of an art project and is the only reason for the web servers existence. The reason for the captive portal is to direct new users who I don't know, to the page without them needing to speak with me first. Basically, I am looking for a way to alert people logging on to the network and into the server that the page exists.

RE: Issue redirecting HTTPS addresses to local server address - Added by gstrauss over 5 years ago

The page is part of an art project

Don't try to write your own captive portal. It's much more complex than you think to get right for the majority of clients out there.

Use an off-the-shelf captive portal, such as nodogsplash, something which is part of OpenWRT/LEDE

    (1-6/6)