只是将它安装在我的Linux桌面上,我只想要1或2个文件访问外部世界。 其他一切应该只能通过http:// localhost /为了各种隐私/安全原因访问。 它只是一个testing服务器,不希望任何人访问我的大批量文件。
你将如何去只允许某些select文件访问互联网,并使所有其他可用只能通过http:// localhost / ?
仅绑定到本地主机:
server.bind = "localhost"
使用iptables:
iptables -I INPUT 1 -p tcp ! -s 127.0.0.1 --dport 80 -j DROP
使用$ HTTP [“remoteip”]:
$HTTP["remoteip"] =~ "127.0.0.1" { alias.url += ( "/" => "/path_to_dir/", ) $HTTP["url"] =~ "^/" { dir-listing.activate = "enable" } }
这是我正在寻找的问题的答案:
$HTTP["host"] != "localhost" { url.access-deny = ("") $HTTP["url"] =~ "^.*/only_allow_this_file\.php$" { url.access-deny = ("disable") } }
没有ip表需要! 只需将“only_allow_this_file”更改为正在进行testing的文件名称,只有该文件可以从互联网上访问。