From 68f850e299f234fa0837467a4a0eb31b9c1f97b9 Mon Sep 17 00:00:00 2001 From: Marcello Coutinho Date: Tue, 3 Dec 2013 03:08:55 -0200 Subject: haproxy-full - move sync to its own tab, add sync to configured backup server change some fields position add shortcut info to haproxy on pfsense 2.1 --- config/haproxy-legacy/haproxy_frontends_edit.php | 247 +++++++++++++---------- 1 file changed, 137 insertions(+), 110 deletions(-) (limited to 'config/haproxy-legacy/haproxy_frontends_edit.php') diff --git a/config/haproxy-legacy/haproxy_frontends_edit.php b/config/haproxy-legacy/haproxy_frontends_edit.php index 548cf612..99391fe9 100755 --- a/config/haproxy-legacy/haproxy_frontends_edit.php +++ b/config/haproxy-legacy/haproxy_frontends_edit.php @@ -3,6 +3,7 @@ /* haproxy_frontends_edit.php part of pfSense (http://www.pfsense.com/) + Copyright (C) 2013 Marcello Coutinho Copyright (C) 2009 Scott Ullrich Copyright (C) 2008 Remco Hoef All rights reserved. @@ -28,7 +29,7 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - +$shortcut_section = "haproxy"; require("guiconfig.inc"); $d_haproxyconfdirty_path = $g['varrun_path'] . "/haproxy.conf.dirty"; @@ -113,12 +114,14 @@ if ($_POST) { if (!$_POST['retries'] && is_numeric($_POST['retries'])) $input_errors[] = "The field 'Retries' value is not a number."; + + if ($_POST['stats_enabled'] == "yes"){ + if (preg_match("/[^a-zA-Z0-9\.\-_]/", $_POST['stats_username'])) + $input_errors[] = "The field 'Stats Username' contains invalid characters."; - if (preg_match("/[^a-zA-Z0-9\.\-_]/", $_POST['stats_username'])) - $input_errors[] = "The field 'Stats Username' contains invalid characters."; - - if (preg_match("/[^a-zA-Z0-9\.\-_]/", $_POST['stats_password'])) - $input_errors[] = "The field 'Stats Password' contains invalid characters."; + if (preg_match("/[^a-zA-Z0-9\.\-_]/", $_POST['stats_password'])) + $input_errors[] = "The field 'Stats Password' contains invalid characters."; + } if (!is_numeric($_POST['max_connections'])) $input_errors[] = "The field 'Max connections' value is not a number."; @@ -391,7 +394,21 @@ include("head.inc");

- +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -530,14 +622,14 @@ set by the 'retries' parameter (2).> > @@ -565,7 +657,7 @@ set by the 'retries' parameter (2).> @@ -577,56 +669,7 @@ set by the 'retries' parameter (2). Example: / or /index.php or /index.html or /testmypage.cgi - - - - - - - - - - - - - - - - - + @@ -679,30 +722,12 @@ set by the 'retries' parameter (2). */ ?> - - - - - - - - - - - + + + + @@ -718,12 +743,14 @@ set by the 'retries' parameter (2). -
 
+
+ +
+
+ @@ -407,30 +424,6 @@ include("head.inc"); size="64"> - - - - - - - - - - - - - + + + + + + + + + +
Edit haproxy backend
Connection timeout - size="64"> -
the time (in milliseconds) we give up if the connection does not complete within (30000).
-
Server timeout - size="64"> -
the time (in milliseconds) we accept to wait for data from the server, or for the server to accept data (30000).
-
Retries - size="64"> -
After a connection failure to a server, it is possible to retry, potentially -on another server. This is useful if health-checks are too rare and you don't -want the clients to see the failures. The number of attempts to reconnect is -set by the 'retries' parameter (2).
-
Type @@ -441,7 +434,43 @@ set by the 'retries' parameter (2).
Port + size="6" maxlength="500"> +
The port to listen to. To specify multiple ports, separate with a comma (,). EXAMPLE: 80,443
+
Listen address + +
+ + If you want this rule to apply to another IP address than the IP address of the interface chosen above, + select it here (you need to define Virtual IP addresses on the first). + Also note that if you are trying to redirect connections on the LAN select the "any" option.
+ While using carp, select localhost and forward via NAT. +
+
Balance @@ -506,6 +535,69 @@ set by the 'retries' parameter (2).
Use 'forwardfor' option + > +
+ The 'forwardfor' option creates an HTTP 'X-Forwarded-For' header which + contains the client's IP address. This is useful to let the final web server + know what the client address was (eg for statistics on domains) +
Use 'httpclose' option + > +
+ The 'httpclose' option removes any 'Connection' header both ways, and + adds a 'Connection: close' header in each direction. This makes it easier to + disable HTTP keep-alive than the previous 4-rules block. +
Connection limits
Connection timeout + size="64"> +
the time (in milliseconds) we give up if the connection does not complete within (30000).
+
Server timeout + size="64"> +
the time (in milliseconds) we accept to wait for data from the server, or for the server to accept data (30000).
+
Retries + size="6"> +
After a connection failure to a server, it is possible to retry, potentially +on another server. This is useful if health-checks are too rare and you don't +want the clients to see the failures. The number of attempts to reconnect is +set by the 'retries' parameter (2).
+
Max connections + size="10" maxlength="10"> +
Client timeout + size="10" maxlength="10"> +
the time (in milliseconds) we accept to wait for data from the client, or for the client to accept data (30000).
+
Backend stats
Stats Enabled
Stats Username - size="64"> + size="25">
Stats Password - size="64"> + size="25">
Stats Refresh - size="10" maxlength="30">
+ size="6" maxlength="30">
Specify the refresh rate of the stats page in seconds, or specified time unit (us, ms, s, m, h, d).
Port - size="30" maxlength="500"> -
The port to listen to. To specify multiple ports, separate with a comma (,). EXAMPLE: 80,443
-
External address - -
- - If you want this rule to apply to another IP address than the IP address of the interface chosen above, - select it here (you need to define Virtual IP addresses on the first). - Also note that if you are trying to redirect connections on the LAN select the "any" option.
- While using carp, select localhost and forward via NAT. -
-
Max connections - size="10" maxlength="10"> -
Client timeout - size="10" maxlength="10"> -
the time (in milliseconds) we accept to wait for data from the client, or for the client to accept data (30000).
-
Use 'forwardfor' option - > -
- The 'forwardfor' option creates an HTTP 'X-Forwarded-For' header which - contains the client's IP address. This is useful to let the final web server - know what the client address was (eg for statistics on domains) -
Use 'httpclose' option - > -
- The 'httpclose' option removes any 'Connection' header both ways, and - adds a 'Connection: close' header in each direction. This makes it easier to - disable HTTP keep-alive than the previous 4-rules block. -
Advanced pass thru - +
Advanced pass thru
+
NOTE: paste text into this box that you would like to pass thru.
NOTE: You must add a firewall rule permitting access to this frontend!
+ +