diff --git a/src/opnsense/service/templates/OPNsense/Captiveportal/+TARGETS b/src/opnsense/service/templates/OPNsense/Captiveportal/+TARGETS index 79d58e8be..765eece56 100644 --- a/src/opnsense/service/templates/OPNsense/Captiveportal/+TARGETS +++ b/src/opnsense/service/templates/OPNsense/Captiveportal/+TARGETS @@ -1,2 +1,3 @@ #rc.conf.d:/etc/rc.conf.d/captiveportal captiveportal.conf:/usr/local/etc/captiveportal.conf +lighttpd-api-dispatcher.conf:/var/etc/lighttpd-api-dispatcher.conf diff --git a/src/opnsense/service/templates/OPNsense/Captiveportal/lighttpd-api-dispatcher.conf b/src/opnsense/service/templates/OPNsense/Captiveportal/lighttpd-api-dispatcher.conf new file mode 100644 index 000000000..939d8768b --- /dev/null +++ b/src/opnsense/service/templates/OPNsense/Captiveportal/lighttpd-api-dispatcher.conf @@ -0,0 +1,75 @@ +# +# lighttpd configuration file for captiveportal API access (used by proxy pass on every zone, only accessible via localhost) +# +############ Options you really have to take care of #################### + +## FreeBSD! +server.event-handler = "freebsd-kqueue" +server.network-backend = "writev" +#server.use-ipv6 = "enable" + +## modules to load +server.modules = ( "mod_access", "mod_expire", "mod_compress", "mod_redirect", + ,"mod_cgi", "mod_fastcgi","mod_alias", "mod_rewrite" +) + +server.max-keep-alive-requests = 15 +server.max-keep-alive-idle = 30 + +## a static document-root, for virtual-hosting take look at the +## server.virtual-* options +server.document-root = "/usr/local/opnsense/www/" + + +# Phalcon api routing +alias.url += ( "/api/" => "/usr/local/opnsense/www/" ) +url.rewrite = ( "^/api/(.*)$" => "/api/api.php?_url=/$1") + + +# Maximum idle time with nothing being written (php downloading) +server.max-write-idle = 999 + +## where to send error-messages to +server.errorlog-use-syslog="enable" + +# files to check for if .../ is requested +server.indexfiles = ( "index.php", "index.html", + "index.htm", "default.htm" ) + +url.access-deny = ( "~", ".inc" ) + + +######### Options that are good to be but not neccesary to be changed ####### + +## bind to port (default: 80) +server.bind = "127.0.0.1" +server.port = 8999 + +## to help the rc.scripts +server.pid-file = "/var/run/lighttpd-api-dispatcher.pid" + +## virtual directory listings +server.dir-listing = "disable" + +## enable debugging +debug.log-request-header = "disable" +debug.log-response-header = "disable" +debug.log-request-handling = "disable" +debug.log-file-not-found = "disable" +server.max-request-size = 2097152 + +#### fastcgi module +## read fastcgi.txt for more info +fastcgi.server = ( ".php" => + ( "localhost" => + ( + "socket" => "/tmp/php-fastcgi.socket", + "max-procs" => 2, + "bin-environment" => ( + "PHP_FCGI_CHILDREN" => "1", + "PHP_FCGI_MAX_REQUESTS" => "500" + ), + "bin-path" => "/usr/local/bin/php-cgi" + ) + ) +)