Actions
Bug #1128
closedmod_simple_vhost modify server.document-root in conditional block
ASK QUESTIONS IN Forums:
Description
This is in 1.5.0-r1801.
when enable mod_simple_vhost,can not use server.document-root and '$HTTP[\"host\"]' conditional block to make special vhost.
lighttpd.conf:
## modules to load server.modules = ( #"mod_simple_vhost", "mod_accesslog" , ) ## # server.document-root = "/opt/virtual/mydomain1.com/" simple-vhost.server-root = "/opt/virtual/" simple-vhost.default-host = "mydomain1.com" simple-vhost.document-root = "/" $HTTP["host"] =~ "(image1|image)\.marry5\.com" { server.document-root = "/thepath/outside/default/root" }
###
wget http://image.otherdomain.com//mydir/myfile.html
###debug log
- without mod_simple_vhost enable ################ #
log.c.148: (trace) server started response.c.217: (trace) -- splitting Request-URI response.c.218: (trace) Request-URI : //mydir/myfile.html response.c.219: (trace) URI-scheme : http response.c.220: (trace) URI-authority: image.otherdomain.com response.c.221: (trace) URI-path : //mydir/myfile.html response.c.222: (trace) URI-query : (null) response.c.276: (trace) -- sanatising URI response.c.277: (trace) URI-path : //mydir/myfile.html response.c.393: (trace) -- before doc_root response.c.394: (trace) Doc-Root : /thepath/outside/default/root response.c.395: (trace) Rel-Path : //mydir/myfile.html response.c.396: (trace) Path : (null) response.c.449: (trace) -- after doc_root
- with mod_simple_vhost enable ################
log.c.148: (trace) server started response.c.217: (trace) -- splitting Request-URI response.c.218: (trace) Request-URI : //mydir/myfile.html response.c.219: (trace) URI-scheme : http response.c.220: (trace) URI-authority: image.otherdomain.com response.c.221: (trace) URI-path : //mydir/myfile.html response.c.222: (trace) URI-query : (null) response.c.276: (trace) -- sanatising URI response.c.277: (trace) URI-path : //mydir/myfile.html response.c.393: (trace) -- before doc_root response.c.394: (trace) Doc-Root : /thepath/outside/default/root response.c.395: (trace) Rel-Path : //mydir/myfile.html response.c.396: (trace) Path : (null) response.c.449: (trace) -- after doc_root response.c.450: (trace) Doc-Root : /opt/virtual/mydomain1.com// response.c.451: (trace) Rel-Path : //mydir/myfile.html response.c.452: (trace) Path : /opt/virtual/mydomain1.com///mydir/myfile.html response.c.471: (trace) -- logical -> physical response.c.472: (trace) Doc-Root : /opt/virtual/mydomain1.com// response.c.473: (trace) Rel-Path : //mydir/myfile.html response.c.474: (trace) Path : /opt/virtual/mydomain1.com///mydir/myfile.html response.c.492: (trace) -- handling physical path response.c.493: (trace) Path : /opt/virtual/mydomain1.com///mydir/myfile.html response.c.492: (trace) -- handling physical path response.c.493: (trace) Path : /opt/virtual/mydomain1.com///mydir/myfile.html response.c.555: (trace) -- file not found response.c.556: (trace) Path : /opt/virtual/mydomain1.com///mydir/myfile.html
Updated by jan over 17 years ago
- Status changed from New to Fixed
- Resolution set to invalid
The same happens if you use different different vhost plugin at the same time. They overwrite each other.
Use a else to handle this.
$HTTP["host"] =~ "(image1|image)\.marry5\.com" { server.document-root = "/thepath/outside/default/root" } else $HTTP["host"] =~ "" { simple-vhost.server-root = "/opt/virtual/" simple-vhost.default-host = "mydomain1.com" simple-vhost.document-root = "/" }
Actions
Also available in: Atom