# vHost file for nginx map $http_upgrade $connection_upgrade_grafana_ssl { default upgrade; '' close; } server { listen 80; listen [::]:80; server_name FQDN; access_log /var/log/nginx/access.log; location / { return 301 https://$host$request_uri; } } server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name FQDN; server_tokens off; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log warn; ssl_certificate /etc/ssl/certs/FQDN.pem; ssl_certificate_key /etc/ssl/private/FQDN.pem; # only if applicable # ssl_trusted_certificate /etc/ssl/certs/cert-bundle.pem; ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305; ssl_prefer_server_ciphers off; ssl_dhparam /etc/nginx/dhparam.pem; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; ssl_stapling on; ssl_stapling_verify on; add_header Strict-Transport-Security "max-age=63072000" always; # Content Security, frame and Type is generated by Grafana already location / { proxy_read_timeout 300; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header CLIENT_IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade_grafana_ssl; # Adjust below port to your environemnt (Grafana default is 3000) proxy_pass http://127.0.0.1:3001; } }