server { listen 80; server_name admin.homaroma.shop; location ~ /.well-known/acme-challenge { allow all; root /var/www/certbot; } location / { return 301 https://$host$request_uri; } } server { listen 443 ssl; server_name admin.homaroma.shop; ssl_certificate /etc/letsencrypt/live/admin.homaroma.shop/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/admin.homaroma.shop/privkey.pem; location / { root /usr/share/nginx/html/homaroma.shop/admin; index index.html index.htm; try_files $uri $uri/ /index.html; } }