server { listen 80; server_name example.com; return 301 https://example.com$request_uri; } server { listen 443 ssl http2; (中略) ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; }