server { listen 80; server_name books.vvvvvvaria.org; return 301 https://$server_name$request_uri; } server { listen 443 ssl; server_name books.vvvvvvaria.org; ssl_certificate /etc/letsencrypt/live/vvvvvvaria.org/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/vvvvvvaria.org/privkey.pem; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers HIGH:!aNULL:!MD5; access_log /var/log/nginx/books.vvvvvvaria.org.log; error_log /var/log/nginx/books.vvvvvvaria.org.log; location / { auth_basic "Congrats! You've reached a members only portion of the site!"; auth_basic_user_file /etc/nginx/.htpasswd; proxy_bind $server_addr; proxy_pass http://127.0.0.1:5000; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Scheme $scheme; } }