server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name {{ node_exporter_domain }}; ssl_certificate {{ certs_dir }}/{{ node_exporter_cert }}/cert.pem; ssl_certificate_key {{ certs_dir }}/{{ node_exporter_cert }}/key.pem; ssl_session_timeout 1d; ssl_session_cache shared:SSL:10m; ssl_session_tickets off; ssl_prefer_server_ciphers on; access_log off; error_log off; location /metrics { proxy_pass http://localhost:9100/metrics; auth_basic "Restricted"; auth_basic_user_file /etc/nginx/.htpasswd; } } server { listen 80; listen [::]:80; server_name tech.ag-link.xyz; return 301 https://{{ node_exporter_domain }}$request_uri; }