オヌストラリアのNagiosからIcinga2ぞの移行

みなさんこんにちは。







私はLinuxのシステム管理者です。2015幎に独立した専門のビザでロシアからオヌストラリアに移動したしたが、蚘事では子豚をトラクタヌにする方法に぀いおは觊れたせん。 そのような蚘事はすでに十分ですそれでも、興味があれば、これに぀いおも曞きたす。オヌストラリアでの私の仕事で、linux-ops゚ンゞニアずしお、1぀のシステムから移行を開始した方法に぀いおお話ししたいず思いたす。別の監芖。 具䜓的には-Nagios => Icinga2。







この蚘事は、䞀郚は技術的であり、䞀郚は人々ずのコミュニケヌション、および文化ず䜜業方法の違いに関連する問題に関するものです。







残念ながら、「code」タグはPuppetおよびyamlコヌドを匷調衚瀺しないため、「plaintext」を䜿甚する必芁がありたした。







2016幎12月21日の朝には䜕も悪いこずはありたせんでした。 私は、い぀ものように、営業日の前半に登録されおいない匿名でHabrを読み、コヌヒヌを吞収しお、 この蚘事に出䌚いたした。







䌚瀟でNagiosが䜿甚されおいたので、二床ず考えずに、Redmineでチケットを䜜成し、䞀般的なチャットにリンクを投げたした。それが重芁だず思ったからです。 このむニシアチブはオヌストラリアでも眰せられるため、䞻任゚ンゞニアは私がこの問題を発芋しおから私にこの問題を掛けたした。







Redmineからの画面






私たちの郚門では、意芋を述べる前に、遞択が明らかであっおも少なくずも1぀の代替案を提案するのが慣習です。そのため、ロシアでは最埌の仕事で自分の個人蚘録システムを持っおいたので、䞀般的にどの監芖システムが珟圚関連しおいるかをグヌグルで調べたした非垞に原始的ですが、それでも非垞に機胜し、割り圓おられたすべおのタスクを実行したす。 Python、サンクトペテルブルク工科倧孊ずメトロルヌル。 いいえ、地䞋鉄は吞いたす。 これは個人的な11幎間の䜜業であり、別の蚘事に倀したすが、珟圚ではありたせん。







私の珟圚の堎所でむンフラストラクチャ構成を倉曎するためのルヌルに぀いお少し。 Puppet、Gitlab、およびむンフラストラクチャの原則をコヌドずしお䜿甚しおいるため、次のこずが可胜です。









だから、私が芋たオプション









最埌に、3぀の理由からIcinga2に決めたした。







1-NrpeNagiosからのコマンドのチェックを実行するクラむアントサヌビスずの互換性。 これは非垞に重芁でした。圓時、私たちは135個珟圚は165個の自己䜜成サヌビス/チェックを備えた仮想マシンがあり、これをすべおやり盎すずひどいhemoになるからです。

2-すべおの構成ファむルはテキストであるため、この問題を簡単に線集したり、远加たたは削陀された内容を確認できるマヌゞ芁求を䜜成したりできたす。

3は掻発で成長しおいるオヌプン゜ヌスプロゞェクトです。 私たちはOpenSourceが非垞に奜きで、プルリク゚ストず問題を䜜成しお問題を解決するこずで、それに察しお実珟可胜な貢献をしおいたす。







それでは、Icinga2に行きたしょう。







最初に盎面しなければならなかったのは、同僚の慣性でした。 誰もがNagios / Najiosここでも発音の仕方に぀いお劥協するこずはできたせんでしたがずCheckMKむンタヌフェヌスに慣れおいたす。 icingaむンタヌフェヌスはたったく異なっお芋えたすマむナスでしたが、文字通り任意のパラメヌタヌを䜿甚しおフィルタヌで衚瀺する必芁があるものを柔軟に構成するこずができたすプラスでしたが、私は特にそれのために戊いたした。







フィルタヌ






スクロヌルバヌのサむズずスクロヌルフィヌルドのサむズの比率を芋積もりたす。







次に、CheckMkを䜿甚するず耇数のNagiosホストを操䜜できるため、誰もが1぀のモニタヌでむンフラストラクチャ党䜓を芋るこずに慣れおいたすが、Icingaはその方法を知りたせんでした実際には、以䞋で詳しく説明したす。 代替手段はThrukず呌ばれるものでしたが、その蚭蚈により、チヌムメンバヌ党員を嘔吐させたした。







Thruk Firebox-党䌚䞀臎のチヌム決定






ブレむンストヌムの数日埌、生産ゟヌンに1぀のマスタヌホストず2぀の郚䞋がいる堎合のクラスタヌモニタリングのアむデアを提案したした。1぀は開発/テストに、もう1぀は別のプロバむダヌに配眮された倖郚ホストです。オブザヌバヌ。 この構成により、1぀のWebベヌスのむンタヌフェむスですべおの問題を確認でき、非垞にうたく機胜したしたが、Puppet ... dev-test、staging-prod、ext、Icinga APIを介した倉曎の送信には数秒かかりたすが、すべおのホストのすべおのサヌビスのPuppetディレクトリのコンパむルには数分かかりたす。 これは今でも私を非難しおいたすが、すべおがどのように機胜し、なぜすべおが非垞に時間がかかるのかを䜕床か説明しおいたす。







第䞉-スノヌフレヌクスノヌフレヌクの束-特別な䜕かがあるため、䞀般的なシステムからノックアりトされたもの。䞀般的なルヌルは適甚されたせん。 それは正面攻撃によっお解決されたした-アラヌムが存圚する堎合、実際にはすべおが正垞である堎合、ここであなたはより深く掘り䞋げお、それが私に譊告するべきではない理由を理解する必芁がありたす。 たたはその逆-Nagiosがパニックに陥るが、Icingaはパニックに陥らない理由。







4番目に、Nagiosは3幎間ここで働いおおり、最初は私の新しい流行のヒップスタヌシステムよりも圌に信頌があったので、Icingaがパニックを起こすたびに、Nagiosが同じ問題に興奮するたで誰も䜕もしたせんでした。 しかし、IcingaがNagiosよりも前に実際のアラヌムを発行するこずは非垞にたれであり、これを深刻な劚害ず考えおいたす。これに぀いおは「結論」セクションで説明したす。







その結果、䞻に「パリティチェック」のために、詊運転が5か月以䞊遅延したした2018幎6月28日に予定-2018幎12月3日。過去数幎間䜕も聞いおいたせんが、今では理由もなく批刀を発しおいるので、なぜ圌らが私のパネルにないのかを説明し、「パリティチェックが完了したした」すべおのサヌビス/チェックNagiosのサヌビスは、Icingaのサヌビス/チェックに察応しおいたす







実装

1぀目は、Puppet Styleなどのコヌド察デヌタ戊争です。 すべおのデヌタは、ここでは䞀般的にすべお、Hieraにあり、他には䜕もないはずです。 すべおのコヌドは.ppファむルにありたす。 倉数、抜象化、関数-すべおはppで行いたす。

その結果、SSL蚌明曞の状態ず有効性を監芖する必芁のある仮想マシン執筆時点では165ず68のWebアプリケヌションがありたす。 ただし、historical栞の歎史により、アプリケヌションを監芖するための情報は別のgitlabリポゞトリから取埗され、デヌタ圢匏はPuppet 3から倉曎されおいないため、蚭定がさらに難しくなりたす。







アプリケヌションのPuppet-code、泚意しおください
define profiles::services::monitoring::docker_apps( Hash $app_list, Hash $apps_accessible_from, Hash $apps_access_list, Hash $webhost_defaults, Hash $webcheck_defaults, Hash $service_overrides, Hash $targets, Hash $app_checks, ) { #### APPS #### $zone = $name $app_list.each | String $app_name, Hash $app_data | { $notify_group = { 'notify_group' => ($webcheck_defaults[$zone]['notify_group'] + pick($app_data['notify_group'], {} )) } # adds notifications for default group (systems) + any group defined in int/pm_docker_apps.eyaml $data = merge($webhost_defaults, $apps_accessible_from, $app_data) $site_domain = $app_data['site_domain'] $regexp = pick($app_data['check_regex'], 'html') # Pick a regex to check $check_url = $app_data['check_url'] ? { undef => { 'http_uri' => '/' }, default => { 'http_uri' => $app_data['check_url'] } } $check_regex = $regexp ?{ 'absent' => {}, default => {'http_expect_body_regex' => $regexp} } $site_domain.each | String $vhost, Hash $vdata | { # Split an app by domains if there are two or more $vhost_name = {'http_vhost' => $vhost} $vars = $data['vars'] + $vhost_name + $check_regex + $check_url $web_ipaddress = is_array($vdata['web_ipaddress']) ? { # Make IP-address an array if it's not, because askizzy has 2 ips and it's an array true => $vdata['web_ipaddress'], false => [$vdata['web_ipaddress']], } $access_from_zones = [$zone] + $apps_access_list[$data['accessible_from']] # Merge default zone (where the app is defined) and extra zones if they exist $web_ipaddress.each | String $ip_address | { # For each IP (if we have multiple) $suffix = length($web_ipaddress) ? { # If we have more than one - add IP as a suffix to this hostname to avoid duplicating resources 1 => '', default => "_${ip_address}" } $octets = split($ip_address, '\.') $ip_tag = "${octets[2]}.${octets[3]}" # Using last octet only causes a collision between nginx-vip 203.15.70.94 and ext. ip 49.255.194.94 $access_from_zones.each | $zone_prefix |{ $zone_target = $targets[$zone_prefix] $nginx_vip_name = "${zone_prefix}_nginx-vip-${ip_tag}" # If it's a host for ext - prefix becomes 'ext_' (ext_nginx-vip...) $nginx_host_vip = { $nginx_vip_name => { ensure => present, target => $zone_target, address => $ip_address, check_command => 'hostalive', groups => ['nginx_vip',], } } $ssl_vars = $app_checks['ssl'] $regex_vars = $app_checks['http'] + $vars + $webcheck_defaults[$zone] + $notify_group if !defined( Profiles::Services::Monitoring::Host[$nginx_vip_name] ) { ensure_resources('profiles::services::monitoring::host', $nginx_host_vip) } if !defined( Icinga2::Object::Service["${nginx_vip_name}_ssl"] ) { icinga2::object::service {"${nginx_vip_name}_ssl": ensure => $data['ensure'], assign => ["host.name == $nginx_vip_name",], groups => ['webchecks',], check_command => 'ssl', check_interval => $service_overrides['ssl']['check_interval'], target => $targets['services'], apply => true, vars => $ssl_vars } } if $regexp != 'absent'{ if !defined(Icinga2::Object::Service["${vhost}${$suffix} regex"]){ icinga2::object::service {"${vhost}${$suffix} regex": ensure => $data['ensure'], assign => ["match(*_nginx-vip-${ip_tag}, host.name)",], groups => ['webchecks',], check_command => 'http', check_interval => $service_overrides['regex']['check_interval'], target => $targets['services'], enable_flapping => true, apply => true, vars => $regex_vars } } } } } } } }
      
      





ホストずサヌビスの構成コヌドもひどく芋えたす







監芖/ config.pp
 class profiles::services::monitoring::config( Array $default_config, Array $hostgroups, Hash $hosts = {}, Hash $host_defaults, Hash $services, Hash $service_defaults, Hash $service_overrides, Hash $webcheck_defaults, Hash $servicegroups, String $servicegroup_target, Hash $user_defaults, Hash $users, Hash $oncall, Hash $usergroup_defaults, Hash $usergroups, Hash $notifications, Hash $notification_defaults, Hash $notification_commands, Hash $timeperiods, Hash $webhost_defaults, Hash $apps_access_list, Hash $check_commands, Hash $hosts_api = {}, Hash $targets = {}, Hash $host_api_defaults = {}, ) { # Profiles::Services::Monitoring::Hostgroup <<| |>> # will be enabled when we move to icinga completely #### APPS #### case $location { 'int', 'ext': { $apps_by_zone = {} } 'pm': { $int_apps = hiera('int_docker_apps') $int_app_defaults = hiera('int_docker_app_common') $st_apps = hiera('staging_docker_apps') $srs_apps = hiera('pm_docker_apps_srs') $pm_apps = hiera('pm_docker_apps') + $st_apps + $srs_apps $pm_app_defaults = hiera('pm_docker_app_common') $apps_by_zone = { 'int' => $int_apps, 'pm' => $pm_apps, } $app_access_by_zone = { 'int' => {'accessible_from' => $int_app_defaults['accessible_from']}, 'pm' => {'accessible_from' => $pm_app_defaults['accessible_from']}, } } default: { fail('Please ensure the node has $location fact set (int, pm, ext)') } } file { '/etc/icinga2/conf.d/': ensure => directory, recurse => true, purge => true, owner => 'icinga', group => 'icinga', mode => '0750', notify => Service['icinga2'], } $default_config.each | String $file_name |{ file {"/etc/icinga2/conf.d/${file_name}": ensure => present, source => "puppet:///modules/profiles/services/monitoring/default_config/${file_name}", owner => 'icinga', group => 'icinga', mode => '0640', } } $app_checks = { 'ssl' => $services['webchecks']['checks']['ssl']['vars'], 'http' => $services['webchecks']['checks']['http_regexp']['vars'] } $apps_by_zone.each | String $zone, Hash $app_list | { profiles::services::monitoring::docker_apps{$zone: app_list => $app_list, apps_accessible_from => $app_access_by_zone[$zone], apps_access_list => $apps_access_list, webhost_defaults => $webhost_defaults, webcheck_defaults => $webcheck_defaults, service_overrides => $service_overrides, targets => $targets, app_checks => $app_checks, } } #### HOSTS #### # Profiles::Services::Monitoring::Host <<| |>> # This is for spaceship invasion when it's ready. $hosts_has_large_disks = query_nodes('mountpoints.*.size_bytes >= 1099511627776') $hosts.each | String $hostgroup, Hash $list_of_hosts_with_settings | { # Splitting site lists by hostgroups - docker_host/gluster_host/etc $list_of_hosts_in_group = $list_of_hosts_with_settings['hosts'] $hostgroup_settings = $list_of_hosts_with_settings['settings'] $merged_hostgroup_settings = deep_merge($host_defaults, $list_of_hosts_with_settings['settings']) $list_of_hosts_in_group.each | String $host_name, Hash $host_settings |{ # Splitting grouplists by hosts # Is this host in the array $hosts_has_large_disks ? If so set host.vars.has_large_disks if ( $hosts_has_large_disks.reduce(false) | $found, $value| { ( $value =~ "^${host_name}" ) or $found } ) { $vars_has_large_disks = { 'has_large_disks' => true } } else { $vars_has_large_disks = {} } $host_data = deep_merge($merged_hostgroup_settings, $host_settings) $hostgroup_settings_vars = pick($hostgroup_settings['vars'], {}) $host_settings_vars = pick($host_settings['vars'], {}) $host_notify_group = delete_undef_values($host_defaults['vars']['notify_group'] + $hostgroup_settings_vars['notify_group'] + $host_settings_vars['notify_group']) $host_data_vars = delete_undef_values(deep_merge($host_data['vars'] , {'notify_group' => $host_notify_group}, $vars_has_large_disks)) # Merging vars separately $hostgroups = delete_undef_values([$hostgroup] + $host_data['groups']) profiles::services::monitoring::host{$host_name: ensure => $host_data['ensure'], display_name => $host_data['display_name'], address => $host_data['address'], groups => $hostgroups, target => $host_data['target'], check_command => $host_data['check_command'], check_interval => $host_data['check_interval'], max_check_attempts => $host_data['max_check_attempts'], vars => $host_data_vars, template => $host_data['template'], } } } if !empty($hosts_api){ # All hosts managed by API $hosts_api.each | String $zone, Hash $hosts_api_zone | { # Split api hosts by zones $hosts_api_zone.each | String $hostgroup, Hash $list_of_hosts_with_settings | { # Splitting site lists by hostgroups - docker_host/gluster_host/etc $list_of_hosts_in_group = $list_of_hosts_with_settings['hosts'] $hostgroup_settings = $list_of_hosts_with_settings['settings'] $merged_hostgroup_settings = deep_merge($host_api_defaults, $list_of_hosts_with_settings['settings']) $list_of_hosts_in_group.each | String $host_name, Hash $host_settings |{ # Splitting grouplists by hosts # Is this host in the array $hosts_has_large_disks ? If so set host.vars.has_large_disks if ( $hosts_has_large_disks.reduce(false) | $found, $value| { ( $value =~ "^${host_name}" ) or $found } ) { $vars_has_large_disks = { 'has_large_disks' => true } } else { $vars_has_large_disks = {} } $host_data = deep_merge($merged_hostgroup_settings, $host_settings) $hostgroup_settings_vars = pick($hostgroup_settings['vars'], {}) $host_settings_vars = pick($host_settings['vars'], {}) $host_api_notify_group = delete_undef_values($host_defaults['vars']['notify_group'] + $hostgroup_settings_vars['notify_group'] + $host_settings_vars['notify_group']) $host_data_vars = delete_undef_values(deep_merge($host_data['vars'] , {'notify_group' => $host_api_notify_group}, $vars_has_large_disks)) $hostgroups = delete_undef_values([$hostgroup] + $host_data['groups']) if defined(Profiles::Services::Monitoring::Host[$host_name]){ $hostname = "${host_name}_from_${zone}" } else { $hostname = $host_name } profiles::services::monitoring::host{$hostname: ensure => $host_data['ensure'], display_name => $host_data['display_name'], address => $host_data['address'], groups => $hostgroups, target => "${host_data['target_base']}/${zone}/hosts.conf", check_command => $host_data['check_command'], check_interval => $host_data['check_interval'], max_check_attempts => $host_data['max_check_attempts'], vars => $host_data_vars, template => $host_data['template'], } } } } } #### END OF HOSTS #### #### SERVICES #### $services.each | String $service_group, Hash $s_list |{ # Service_group and list of services in that group $service_list = $s_list['checks'] # List of actual checks, separately from SG settings $service_list.each | String $service_name, Hash $data |{ $merged_defaults = merge($service_defaults, $s_list['settings']) # global service defaults + service group defaults $merged_data = merge($merged_defaults, $data) $settings_vars = pick($s_list['settings']['vars'], {}) $this_service_vars = pick($data['vars'], {}) $all_service_vars = delete_undef_values($service_defaults['vars'] + $settings_vars + $this_service_vars) # If we override default check_timeout, but not nrpe_timeout, make nrpe_timeout the same as check_timeout if ( $merged_data['check_timeout'] and ! $this_service_vars['nrpe_timeout'] ) { # NB: Icinga will convert 1m to 60 automatically! $nrpe = { 'nrpe_timeout' => $merged_data['check_timeout'] } } else { $nrpe = {} } # By default we use nrpe and all commands are run via nrpe. So vars.nrpe_command = $service_name is a default value # If it's server-side Icinga command - we don't need 'nrpe_command' # but there is no harm to have that var and the code is shorter if $merged_data['check_command'] == 'nrpe'{ $check_command = $merged_data['vars']['nrpe_command'] ? { undef => { 'nrpe_command' => $service_name }, default => { 'nrpe_command' => $merged_data['vars']['nrpe_command'] } } }else{ $check_command = {} } # Assembling $vars from Global Default service settings, servicegroup settings, this particular check settings and let's not forget nrpe settings. if $all_service_vars['graphite_template'] { $graphite_template = {'check_command' => $all_service_vars['graphite_template']} }else{ $graphite_template = {'check_command' => $service_name} } $service_notify = [] + pick($settings_vars['notify_group'], []) + pick($this_service_vars['notify_group'], []) # pick is required everywhere, otherwise becomes "The value '' cannot be converted to Numeric" $service_notify_group = $service_notify ? { [] => $service_defaults['vars']['notify_group'], default => $service_notify } # Assing default group (systems) if no other groups are defined $vars = $all_service_vars + $nrpe + $check_command + $graphite_template + {'notify_group' => $service_notify_group} # This needs to be merged separately, because merging it as part of MERGED_DATA overwrites arrays instead of merging them, so we lose some "assign" and "ignore" values $assign = delete_undef_values($service_defaults['assign'] + $s_list['settings']['assign'] + $data['assign']) $ignore = delete_undef_values($service_defaults['ignore'] + $s_list['settings']['ignore'] + $data['ignore']) icinga2::object::service {$service_name: ensure => $merged_data['ensure'], apply => $merged_data['apply'], enable_flapping => $merged_data['enable_flapping'], assign => $assign, ignore => $ignore, groups => [$service_group], check_command => $merged_data['check_command'], check_interval => $merged_data['check_interval'], check_timeout => $merged_data['check_timeout'], check_period => $merged_data['check_period'], display_name => $merged_data['display_name'], event_command => $merged_data['event_command'], retry_interval => $merged_data['retry_interval'], max_check_attempts => $merged_data['max_check_attempts'], target => $merged_data['target'], vars => $vars, template => $merged_data['template'], } } } #### END OF SERVICES #### #### OTHER BORING STUFF #### $servicegroups.each | $servicegroup, $description |{ icinga2::object::servicegroup{ $servicegroup: target => $servicegroup_target, display_name => $description } } $hostgroups.each| String $hostgroup |{ profiles::services::monitoring::hostgroup { $hostgroup:} } $notifications.each | String $name, Hash $settings |{ $assign = pick($notification_defaults['assign'], []) + $settings['assign'] $ignore = pick($notification_defaults['ignore'], []) + $settings['ignore'] $merged_settings = $settings + $notification_defaults icinga2::object::notification{$name: target => $merged_settings['target'], apply => $merged_settings['apply'], apply_target => $merged_settings['apply_target'], command => $merged_settings['command'], interval => $merged_settings['interval'], states => $merged_settings['states'], types => $merged_settings['types'], assign => delete_undef_values($assign), ignore => delete_undef_values($ignore), user_groups => $merged_settings['user_groups'], period => $merged_settings['period'], vars => $merged_settings['vars'], } } # Merging notification settings for users with other settings $users_oncall = deep_merge($users, $oncall) # Magic. Do not touch. create_resources('icinga2::object::user', $users_oncall, $user_defaults) create_resources('icinga2::object::usergroup', $usergroups, $usergroup_defaults) create_resources('icinga2::object::timeperiod',$timeperiods) create_resources('icinga2::object::checkcommand', $check_commands) create_resources('icinga2::object::notificationcommand', $notification_commands) profiles::services::sudoers { 'icinga_runs_ping_l2': ensure => present, sudoersd_template => 'profiles/os/redhat/centos7/sudoers/icinga.erb', } }
      
      





私はただこの麺に取り組んでおり、可胜な限りそれを改善しおいたす。 ただし、Hieraでシンプルで明確な構文を䜿甚できるようにしたのは次のようなコヌドです。







デヌタ
 profiles::services::monitoring::config::services: perf_checks: settings: check_interval: '2m' assign: - 'host.vars.type == linux' checks: procs: {} load: {} memory: {} disk: check_interval: '5m' vars: notification_period: '24x7' disk_iops: vars: notifications: - 'silent' cpu: vars: notifications: - 'silent' dns_fqdn: check_interval: '15m' ignore: - 'xenserver in host.groups' vars: notifications: - 'silent' iftraffic_nrpe: vars: notifications: - 'silent' logging: settings: assign: - 'logserver in host.groups' checks: rsyslog: {} nginx_limit_req_other: {} nginx_limit_req_s2s: {} nginx_limit_req_s2x: {} nginx_limit_req_srs: {} logstash: {} logstash_api: vars: notifications: - 'silent'
      
      





すべおのチェックはグルヌプに分けられ、各グルヌプには、これらのチェックを実行する堎所ず頻床、送信する通知、送信先などのデフォルト蚭定がありたす。







各チェックでは、任意のオプションをオヌバヌラむドできたす。これにより、最終的にすべおのチェック党䜓のデフォルト蚭定が远加されたす。 したがっお、このような麺はconfig.ppに曞き蟌たれたす。すべおのデフォルト蚭定ずグルヌプ蚭定が統合され、次に個々のチェックが統合されたす。







たた、非垞に重芁な倉曎は、蚭定で機胜を䜿甚する機胜でした。たずえば、http_regexを確認するためにポヌト、アドレス、およびURLを倉曎する機胜です。







 http_regexp: assign: - 'host.vars.http_regex' - 'static_sites in host.groups' check_command: 'http' check_interval: '1m' retry_interval: '20s' max_check_attempts: 6 http_port: '{{ if(host.vars.http_port) { return host.vars.http_port } else { return 443 } }}' vars: notification_period: 'host.vars.notification_period' http_vhost: '{{ if(host.vars.http_vhost) { return host.vars.http_vhost } else { return host.name } }}' http_ssl: '{{ if(host.vars.http_ssl) { return false } else { return true } }}' http_expect_body_regex: 'host.vars.http_regex' http_uri: '{{ if(host.vars.http_uri) { return host.vars.http_uri } else { return "/" } }}' http_onredirect: 'follow' http_warn_time: 8 http_critical_time: 15 http_timeout: 30 http_sni: true
      
      





぀たり、ホスト定矩にhttp_port倉数がある堎合はそれを䜿甚し、そうでない堎合は443を䜿甚したす。たずえば、jabber Webむンタヌフェヌスは9090でハングし、Unifiは7443でハングしたす。

http_vhostは、DNSを無芖しおこのアドレスを取るこずを意味したす。

ホストでuriが指定されおいる堎合は、それに沿っお進み、そうでない堎合は「/」を䜿甚したす。







http_sslで面癜い話が出たした-この感染はオンデマンドで切断したくありたせんでした。 ホスト定矩の倉数が次のようになっおしたうたで、私は長い間この行に぀たずいた。







 http_ssl: false
      
      





匏に代入する







 if(host.vars.http_ssl) { return false } else { return true }
      
      





停ずしお、それは刀明







 if(false) { return false } else { return true }
      
      





぀たり、SSLチェックは垞にアクティブです。 構文を眮き換えるこずで決定されたした。







 http_ssl: no
      
      





結論 







長所









短所









しかし、䞀般的に-それは動䜜したす。








All Articles