(newbie) Hi, I see that a lighttpd "package" is available on opnsense.
In the past I have used lighttpd to simulate redirection of web pages like so:
$HTTP["host"] =~ "plex|plex.lan" {
url.redirect = ("" => "http://myserver:32400/web")
url.redirect-code = 302
}
So the point of this was that the name (http: // plex) is resolved by a web server local to the DNS server and I'll have an alias set up to repoint to a different host (eg. myserver). Think of them as intranet "shortcuts" for webapps. In fact I use this in pihole on a different setup where the DNS resolver works seemlessly with lighttpd - all on the same host.
Problematic as this may sound/be, is there a way to reuse lighttpd on the opnsense host in a similar way (and making sure the management GUI still works) ?
Edit: or a different way of accomplishing the same thing but from the same host. eg. nginx. I dont know too much about reverse proxies. I just know this trick above and it's worked for years.
Thanks
If you just need aliases for hosts, you can use unbounds overwrites and set a CNAME (=DNS alias) to your server. But this does not work with ports like in your example. Just the DNS name is aliased - port stays the same.
lighthttpd is used to serve the internal web GUI. For your purpose I would propose to use nginx. Just define your destination as upstream and create an URL rewrite rule
Actually I do not really get the use case, since a simple browser bookmark would do the same. Assign it a keyboard shortcut and you do not have to type anything.
@hbc - thank you for the response.
Yes I understand the host alias is limited to host and not port. That's fine.
Ah I see, so probably not best to mess with lighttpd as there is a risk that the gui can break and any changes "on top" might not be compatible with upgrades I'm guessing. So i will read up on nginx.
Use case: You're right simple browser bookmark will do, but not with 10 laptops in the house for various people. Many places of work use these intranet shortcuts. You only have to change the underlying URL but the "shortcut alias" never has to change. Plus I can actually remember the shortcut names for the home lab, eg: "plex", "wiki", "wifirouter", "sense", etc.