How to configure lighttpd to only allow current subnet to access?

3k views Asked by At

I'm new to lighttpd. Here is the goal I want to achieve. I want only the client in my current can access my lighttpd server. For example, current ip address of lighttpd server is '192.168.10.100', only the client with ip address '192.168.10.0/24' can aceess the lighttpd server. The server ip address may change. How to configure lighttpd to only allow current subnet to access?

Here is what I tried. I don't know how to fill the remoteip value. Can anyone help me out? Thanks in advance.

$HTTP["remoteip"] == "192.168.10.0/24" {

}
1

There are 1 answers

3
gstrauss On

See https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModAccess

server.modules += ( "mod_access" )

$HTTP["remoteip"] != "192.168.10.0/24" {
  url.access-deny = ("")
}