diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr
index c739a0215..122f67789 100644
--- a/net/haproxy/pkg-descr
+++ b/net/haproxy/pkg-descr
@@ -13,6 +13,7 @@ Added:
* add new SSL bind option: prefer-client-ciphers
* add global option to enable old buggy behaviour for PROXY v2 connections
* add support for HTTP/2 in health checks
+* add config export (#2035)
Fixed:
* fix maintenance page (python error: 'list' object has no attribute 'strip')
diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ExportController.php b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ExportController.php
new file mode 100644
index 000000000..89f9df4ca
--- /dev/null
+++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ExportController.php
@@ -0,0 +1,83 @@
+configdRun("haproxy showconf");
+ return array("response" => $response);
+ }
+
+ /**
+ * download config file or config archive
+ * @return array|mixed
+ */
+ public function downloadAction($type)
+ {
+ $backend = new Backend();
+
+ if ($type == 'config') {
+ $result = $backend->configdRun("haproxy showconf");
+ $filename = 'haproxy.conf';
+ $filetype = 'text/plain';
+ $content = $result;
+ } else {
+ $result = $backend->configdRun("haproxy exportall");
+ $filename = 'haproxy_config_export.zip';
+ $filetype = 'application/zip';
+ $content = file_get_contents('/tmp/haproxy_config_export.zip');
+ }
+
+ $response = array(
+ 'result' => $result,
+ 'filename' => $filename,
+ 'filetype' => $filetype,
+ 'content' => base64_encode($content),
+ );
+ return $response;
+ }
+}
diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/ExportController.php b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/ExportController.php
new file mode 100644
index 000000000..390adaded
--- /dev/null
+++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/ExportController.php
@@ -0,0 +1,45 @@
+view->pick('OPNsense/HAProxy/export');
+ }
+}
diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Menu/Menu.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Menu/Menu.xml
index 8d12e55ab..520fcc7c3 100644
--- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Menu/Menu.xml
+++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Menu/Menu.xml
@@ -32,6 +32,7 @@