webmcp
view doc/lighttpd.sample.conf @ 122:ff39d4a310b9
Float parser for JSON library (non strict)
| author | jbe | 
|---|---|
| date | Fri Jul 25 22:50:12 2014 +0200 (2014-07-25) | 
| parents | c92bd1ec1130 | 
| children | 
 line source
     1 # Lighttpd modules needed by WebMCP
     2 server.modules += (
     3   "mod_cgi",
     4   "mod_alias",
     5   "mod_setenv",
     6   "mod_rewrite",
     7   "mod_redirect",
     8  )
    10 # Enable CGI-Execution of *.lua files through lua binary
    11 cgi.assign += ( ".lua" => "/__INSERT_LOCAL_FILE_PATH_TO_LUA_BINARY_HERE__/lua" )
    13 # Connect external URLs to server static files and the webmcp cgi interface
    14 alias.url += (
    15   "/webmcp-demo/static/" => "/__INSERT_LOCAL_FILE_PATH_TO_DEMO_APPLICATION_HERE__/static/",
    16   "/webmcp-demo/"        => "/__INSERT_LOCAL_FILE_PATH_TO_WEBMCP_FRAMEWORK_HERE__/cgi-bin/" )
    18 # Configure environment for demo application    
    19 $HTTP["url"] =~ "^/webmcp-demo/" {
    20   setenv.add-environment += (
    21     "WEBMCP_APP_BASEPATH" => "/__INSERT_LOCAL_FILE_PATH_TO_DEMO_APPLICATION_HERE__",
    22     "WEBMCP_CONFIG_NAME"  => "demo")
    23 }
    25 # URL beautification
    26 url.rewrite-once += (
    28   # do not rewrite static URLs
    29       "^/webmcp-demo/static/(.*)$" =>
    30       "/webmcp-demo/static/$1",
    32   # dynamic URLs
    33       "^/webmcp-demo/([^\?]*)(\?(.*))?$" =>
    34       "/webmcp-demo/webmcp-wrapper.lua?_webmcp_path=$1&$3",
    36 )
    38 # Redirects for URLs without trailing slashes
    39 url.redirect += (
    40   # base URL without trailing slash
    41       "^/webmcp-demo$" => "/webmcp-demo/",
    42   # module base URL without trailing slash
    43       "^/webmcp-demo/([^/\?]+)$" => "/webmcp-demo/$1/",
    44 )
