From c4a278f2acd1b4df900eb6d6901a3d425887ec00 Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Wed, 30 Dec 2015 22:00:34 -0600 Subject: [PATCH] start switching CP to nginx --- src/etc/inc/captiveportal.inc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/etc/inc/captiveportal.inc b/src/etc/inc/captiveportal.inc index 0730962200..53e6034884 100644 --- a/src/etc/inc/captiveportal.inc +++ b/src/etc/inc/captiveportal.inc @@ -417,35 +417,35 @@ function captiveportal_init_webgui_zone($cpcfg) { $key = base64_decode($cert['prv']); $ca = ca_chain($cert); - /* generate lighttpd configuration */ + /* generate nginx configuration */ if (!empty($cpcfg['listenporthttps'])) { $listenporthttps = $cpcfg['listenporthttps']; } else { $listenporthttps = 8001 + $cpcfg['zoneid']; } - system_generate_lighty_config("{$g['varetc_path']}/lighty-{$cpzone}-CaptivePortal-SSL.conf", - $crt, $key, $ca, "lighty-{$cpzone}-CaptivePortal-SSL.pid", $listenporthttps, "/usr/local/captiveportal", + system_generate_nginx_config("{$g['varetc_path']}/nginx-{$cpzone}-CaptivePortal-SSL.conf", + $crt, $key, $ca, "nginx-{$cpzone}-CaptivePortal-SSL.pid", $listenporthttps, "/usr/local/captiveportal", "cert-{$cpzone}-portal.pem", "ca-{$cpzone}-portal.pem", $cpzone); } - /* generate lighttpd configuration */ + /* generate nginx configuration */ if (!empty($cpcfg['listenporthttp'])) { $listenporthttp = $cpcfg['listenporthttp']; } else { $listenporthttp = 8000 + $cpcfg['zoneid']; } - system_generate_lighty_config("{$g['varetc_path']}/lighty-{$cpzone}-CaptivePortal.conf", - "", "", "", "lighty-{$cpzone}-CaptivePortal.pid", $listenporthttp, "/usr/local/captiveportal", + system_generate_nginx_config("{$g['varetc_path']}/nginx-{$cpzone}-CaptivePortal.conf", + "", "", "", "nginx-{$cpzone}-CaptivePortal.pid", $listenporthttp, "/usr/local/captiveportal", "", "", $cpzone); - @unlink("{$g['varrun']}/lighty-{$cpzone}-CaptivePortal.pid"); - /* attempt to start lighttpd */ - $res = mwexec("/usr/local/sbin/lighttpd -f {$g['varetc_path']}/lighty-{$cpzone}-CaptivePortal.conf"); + @unlink("{$g['varrun']}/nginx-{$cpzone}-CaptivePortal.pid"); + /* attempt to start nginx */ + $res = mwexec("/usr/local/sbin/nginx -c {$g['varetc_path']}/lighty-{$cpzone}-CaptivePortal.conf"); /* fire up https instance */ if (isset($cpcfg['httpslogin'])) { - @unlink("{$g['varrun']}/lighty-{$cpzone}-CaptivePortal-SSL.pid"); - $res = mwexec("/usr/local/sbin/lighttpd -f {$g['varetc_path']}/lighty-{$cpzone}-CaptivePortal-SSL.conf"); + @unlink("{$g['varrun']}/nginx-{$cpzone}-CaptivePortal-SSL.pid"); + $res = mwexec("/usr/local/sbin/nginx -c {$g['varetc_path']}/nginx-{$cpzone}-CaptivePortal-SSL.conf"); } }