Ticket #1092 (closed defect: wontfix)

Opened 1 year ago

Last modified 3 months ago

reuse of $HTTP["host"] =~ "hostname" error if SSL forwarding enabled

Reported by: phaidros Assigned to: jan
Priority: high Milestone:
Component: core Version: 1.4.13
Severity: normal Keywords:
Cc: Blocking:
Need Feedback: 0

Description

Using the construct mentioned in the docs for ssl http://trac.lighttpd.net/trac/wiki/HowToRedirectHttpToHttps

otherwise I get

"(network.c.300) can't bind to port: 80 Address already in use" 

That works, as long as I don't use:

$HTTP["host"] == "example.com" 
or 
'$HTTP["host"] == "example.org"

anywhere else (eg. mod_auth or mod_cgi).

if so I get at lighty startup:

lighttpd: ./configparser.y:348: yy_reduce: Assertion  
`yymsp[-3].minor.yy78->context_ndx < yymsp[0].minor.yy78->context_ndx' failed.

confs:

-------------------------------------------------------------------------------
10-ssl.conf:

$SERVER["socket"] == "0.0.0.0:443" {
                  ssl.engine         = "enable"
                  ssl.pemfile        = "/etc/lighttpd/keys/example.com.pem"
                  ssl.ca-file        = "/etc/lighttpd/keys/cacert.crt"
        }
else $HTTP["host"] == "example.com" {
                url.redirect = ( "^/(.*)" => "https://example.com/$1" )
        }
else $HTTP["host"] == "example.org" {
                url.redirect = ( "^/(.*)" => "https://example.org/$1" )

-------------------------------------------------------------------------------
lighttpd.conf

server.modules              = (
            "mod_access",
            "mod_alias",
            "mod_accesslog",
            "mod_rewrite",
            "mod_redirect",
 )
server.document-root       = "/var/www/servers/example.com"
server.errorlog            = "/var/log/lighttpd/error.log"
index-file.names           = ( "index.php", "index.html",
accesslog.filename         = "/var/log/lighttpd/access.log"
url.access-deny            = ( "~", ".inc" )
server.port = 80
server.bind = "0.0.0.0"
server.pid-file            = "/var/run/lighttpd.pid"
dir-listing.encoding        = "utf-8"
server.dir-listing          = "enable"
server.username            = "www-data"
server.groupname           = "www-data"
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
-------------------------------------------------------------------------------
10-simple-vhost:

simple-vhost.server-root         = "/var/www/servers/"
simple-vhost.document-root       = "/pages/"
-------------------------------------------------------------------------------
I try to use e.g. 10-auth.conf

auth.require = ( "/postfix/admin/" =>
                 (
                   "method"  => "basic",
                   "realm"   => "no no noo",
                   "require" => "valid-user"   
                 ))
$HTTP["host"] == "example.com" { 
                 auth.require = ( "/" =>   
                 (
                   "method"  => "basic",
                   "realm"   => "no no noo",
                   "require" => "valid-user"
                 ))
}
------------------------------------------------------------------------------
.. where the auth for postfix/admin works. but as soon as the 
HTTP["host"] directive is in use lighty gives the above startup error.

Attachments

Change History

04/24/2008 09:18:16 PM changed by stbuehler

  • status changed from new to closed.
  • resolution set to wontfix.
  • pending changed.

You can use one conditional test only once in a block, that is what the configparser checks (this is somewhat by design and i guess it would reqire a rewrite, so wontfix this in 1.4)


Add/Change #1092 (reuse of $HTTP["host"] =~ "hostname" error if SSL forwarding enabled)




Change Properties
Action