vhost_ssl_disabled.tpl.php 1.35 KB
Newer Older
1 2 3

<?php if ($this->ssl_enabled && $this->ssl_key) : ?>

4 5 6 7 8
<?php
$satellite_mode = drush_get_option('satellite_mode');
if (!$satellite_mode && $server->satellite_mode) {
  $satellite_mode = $server->satellite_mode;
}
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27

$nginx_has_http2 = drush_get_option('nginx_has_http2');
if (!$nginx_has_http2 && $server->nginx_has_http2) {
  $nginx_has_http2 = $server->nginx_has_http2;
}

if ($nginx_has_http2) {
  $ssl_args = "ssl http2";
}
else {
  $ssl_args = "ssl";
}

if ($satellite_mode == 'boa') {
  $ssl_listen_ip = "*";
}
else {
  $ssl_listen_ip = $ip_address;
}
28 29
?>

30
server {
31
  listen       <?php print "{$ssl_listen_ip}:{$http_ssl_port} {$ssl_args}"; ?>;
32 33 34 35
  server_name  <?php print $this->uri . ' ' . implode(' ', str_replace('/', '.', $this->aliases)); ?>;
<?php if ($satellite_mode == 'boa'): ?>
  root         /var/www/nginx-default;
  index        index.html index.htm;
36
  ### Do not reveal Aegir front-end URL here.
37
<?php else: ?>
38
  return 302 <?php print $this->platform->server->web_disable_url . '/' . $this->uri ?>;
39
<?php endif; ?>
40 41 42 43
  ssl                        on;
  ssl_certificate            <?php print $ssl_cert; ?>;
  ssl_certificate_key        <?php print $ssl_cert_key; ?>;
  keepalive_timeout          70;
44 45 46 47
}

<?php endif; ?>

48 49 50
<?php
  // Generate the standard virtual host too.
  include(provision_class_directory('Provision_Config_Nginx_Site') . '/vhost_disabled.tpl.php');
51
?>