server { listen 80; listen [::]:80; server_name pi.hole; return https://$host$request_uri; } server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name pi.hole; ssl_certificate 'ssl/pi.hole.crt'; ssl_certificate_key 'ssl/pi.hole.key'; location / { proxy_pass http://localhost:81; include proxy.conf; } # let's go directly to the login page location = / { return $scheme://$host/admin/index.php?login; } }