From e4563e9c309a26f6e3cd3b6628f2858f7d54bf75 Mon Sep 17 00:00:00 2001 From: staticsafe Date: Sat, 23 Mar 2019 15:45:30 -0400 Subject: [PATCH] add webserver config to ubuntu/prometheus.sickstack.com.yml --- ubuntu/prometheus.sickstack.com.yml | 48 +++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/ubuntu/prometheus.sickstack.com.yml b/ubuntu/prometheus.sickstack.com.yml index 877c45c..4f06f0e 100644 --- a/ubuntu/prometheus.sickstack.com.yml +++ b/ubuntu/prometheus.sickstack.com.yml @@ -28,3 +28,51 @@ access: proxy url: 'http://localhost:9090' basicAuth: false + +- hosts: webservers + + roles: + - role: jdauphant.nginx + nginx_user: "www-data" + nginx_http_params: + - sendfile "on" + - server_names_hash_bucket_size 512 + nginx_sites: + grafana.asininetech.net.http: + - listen *:80 + - listen [::]:80 + - server_name grafana.asininetech.net + - location /.well-known/acme-challenge/ { + allow all; + } + - return 301 "https://$host$request_uri" + grafana.asininetech.net.https: + - listen *:443 ssl http2 + - listen [::]:443 ssl http2 + - server_name grafana.asininetech.net + - access_log off + - error_log "/var/log/nginx/grafana.asininetech.net.error.log" + - ssl_certificate "/etc/ssl/letsencrypt/grafana.asininetech.net.crt" + - ssl_certificate_key "/etc/ssl/letsencrypt/grafana.asininetech.net.pem" + - add_header Strict-Transport-Security max-age=31536000 + - location / { + proxy_pass http://grafana; + } + + nginx_configs: + gzip: + - gzip on + - gzip_disable msie6 + - gzip_vary on + - gzip_proxied any + - gzip_comp_level 6 + - gzip_buffers 16 8k + - gzip_http_version 1.1 + - gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript + upstream: + - upstream grafana { server localhost:3000; keepalive 1024; } + ssl: + - ssl_protocols TLSv1.2 + - ssl_session_timeout 1d + - ssl_session_cache shared:SSL:50m + - ssl_session_tickets off