我想设置我的服务器上的特定path的文件mimetypes,这是运行lighttpd版本1.4.31与SSL。
我正在遵循这个configuration文件: http : //redmine.lighttpd.net/projects/1/wiki/docs_configuration
指定$PHYSICAL["path"]直到lighttpd版本1.5.0才有效,所以我试图指定$HTTP["url"] 。
我已经尝试了两个
$HTTP["url"] == '/my_path/directory_to_affect/foo.html' { # my settings are in here }
和
$HTTP["url"] =~ '/my_path/directory_to_affect/*' { # my settings are in here }
如果我用lighttpd -D -f lighttpd.conftesting我的configuration文件,或者尝试重新启动lighttpd,我得到这个错误:
2015-04-29 14:37:52: (configfile.c.892) source: /etc/lighttpd/lighttpd.conf line: 48 pos: 12 invalid character in variable name 2015-04-29 14:37:52: (configfile.c.948) configfile parser failed at: ==
或者相同的错误,但是说=~而不是== 。
我感到困惑的是,已经有其他的条件configuration,例如$SERVER["socket"] == ":80" ,这些configuration工作得很好。
根据configuration文件语法的lighttpd文档 ,只有双引号" ,不'支持。
你的观察, $SERVER["socket"] == ":80"作品,但$HTTP["url"] == '/my_path/'不是,确认这一点。