|
68 | 68 | $v_ssl_home = $data[$v_domain]['SSL_HOME']; |
69 | 69 | $v_backend_template = $data[$v_domain]['BACKEND']; |
70 | 70 | $v_nginx_cache = $data[$v_domain]['FASTCGI_CACHE']; |
71 | | -$v_nginx_cache_length = $data[$v_domain]['FASTCGI_CACHE_LENGTH']; |
72 | | -if(empty($v_nginx_cache_length)){ |
| 71 | +$v_nginx_cache_length = $data[$v_domain]['FASTCGI_DURATION']; |
| 72 | +$v_nginx_cache_check = '' |
| 73 | +if(empty($v_nginx_duration)){ |
73 | 74 | $v_nginx_cache_length = '30m'; |
| 75 | + $v_nginx_cache_check = 'on'; |
74 | 76 | } |
| 77 | +; |
75 | 78 | $v_proxy = $data[$v_domain]['PROXY']; |
76 | 79 | $v_proxy_template = $data[$v_domain]['PROXY']; |
77 | 80 | $v_proxy_ext = str_replace(',', ', ', $data[$v_domain]['PROXY_EXT']); |
|
333 | 336 | } |
334 | 337 |
|
335 | 338 | // Enable/Disable nginx cache |
336 | | - if (($_SESSION['WEB_SYSTEM'] == 'nginx') && ($v_nginx_cache != $_POST['v_nginx_cache'] ) && ($v_nginx_cache_length != $_POST['v_nginx_cache_length'] && $_POST['v_nginx_cache'] = "yes" ) && (empty($_SESSION['error_msg']))) { |
337 | | - if ( $_POST['v_nginx_cache'] == 'yes' ) { |
| 339 | + if (($_SESSION['WEB_SYSTEM'] == 'nginx') && ($v_nginx_cache_check != $_POST['v_nginx_cache_check'] ) && ($v_nginx_cache_length != $_POST['v_nginx_cache_length'] && $_POST['v_nginx_cache'] = "yes" ) && (empty($_SESSION['error_msg']))) { |
| 340 | + if ( $_POST['v_nginx_cache_check'] == 'on' ) { |
338 | 341 | if (!empty ($_POST['v_nginx_cache_length'])){ |
339 | | - echo $_POST['v_nginx_cache_length'] = "30m"; |
| 342 | + echo $_POST['v_nginx_cache_length'] = "2m"; |
340 | 343 | } |
341 | | - exec (HESTIA_CMD."v-add-fastcgi-cache ".$v_username." ".escapeshellarg($v_domain).' '. escapeshellarg($_POST['v_nginx_cache_length']) , $output, $return_var); |
| 344 | + exec (HESTIA_CMD."v-add-fastcgi-cache ".$v_username." ".escapeshellarg($v_domain).' '. escapeshellarg($_POST['v_nginx_duration']) , $output, $return_var); |
342 | 345 | check_return_code($return_var,$output); |
343 | 346 | unset($output); |
344 | 347 | } else { |
345 | 348 | exec (HESTIA_CMD."v-delete-fastcgi-cache ".$v_username." ".escapeshellarg($v_domain), $output, $return_var); |
346 | 349 | check_return_code($return_var,$output); |
347 | 350 | unset($output); |
348 | 351 | } |
349 | | - $restart_proxy = 'yes'; |
| 352 | + $restart_web = 'yes'; |
350 | 353 | } |
351 | 354 |
|
352 | 355 | // Delete proxy support |
|
355 | 358 | check_return_code($return_var,$output); |
356 | 359 | unset($output); |
357 | 360 | unset($v_proxy); |
358 | | - $restart_proxy = 'yes'; |
| 361 | + $restart_web = 'yes'; |
359 | 362 | } |
360 | 363 |
|
361 | 364 | // Change proxy template / Update extension list |
|
0 commit comments