0) { header("Location: haproxy_listeners.php"); echo "touching: $d_haproxyconfdirty_path"; touch($d_haproxyconfdirty_path); write_config($changedesc); exit; } } function template_errorfile() { global $config, $d_haproxyconfdirty_path, $savemsg; $a_files = &$config['installedpackages']['haproxy']['files']['item']; if (!is_array($a_files)) $a_files = array(); $a_files_cache = haproxy_get_fileslist(); if (!isset($a_files_cache["ExampleErrorfile"])) { $errorfile = << Sorry the webserver you are trying to contact is currently not available.

Sorry the webserver you are trying to contact is currently not available.

The error returned is [{errorcode} {errormsg}] please try again later. EOD; $newfile = array(); $newfile['name'] = "ExampleErrorfile"; $newfile['content'] = base64_encode($errorfile); $a_files[] = $newfile; $changecount++; $changedesc = "Errorfile added from template"; } else { $savemsg = "File 'ExampleErrorfile' is already configured on the Files tab."; } if ($changecount > 0) { header("Location: haproxy_files.php"); echo "touching: $d_haproxyconfdirty_path"; touch($d_haproxyconfdirty_path); write_config($changedesc); exit; } } if (isset($_GET['add_stats_example'])) { $templateid = $_GET['add_stats_example']; switch ($templateid) { case "1": haproxy_add_stats_example(); break; case "2": template_errorfile(); break; } } if ($_POST) { if ($_POST['apply']) { $result = haproxy_check_and_run($savemsg, true); if ($result) unlink_if_exists($d_haproxyconfdirty_path); } } $pgtitle = "Services: HAProxy: Templates"; include("head.inc"); ?>

You must apply the changes in order for them to take effect.");?>
Templates
This page contains some templates that can be added into the haproxy configuration to possible ways to configure haproxy using this the webgui from this package.
 
Stats SSL frontent+backend
Create configuration As an basic example you can use the link below to create a 'stats' frontend/backend page which offers with more options like setting user/password and 'admin mode' when you go to the backend settings.
TEMPLATE: Create stats example configuration using a frontend/backend combination with ssl

After applying the changes made by the template use this link to visit the stats page: :444">https://pfSense-LAN-ip:444/
 
Errorfile
Create configuration As an basic example of an errorfile with name 'ExampleErrorfile' will be added if it does not exist. This file can then be used in the 'Error files' in the backend settings.