server { listen 80; server_name spa.ddc.kittisak.com; location /.well-known/acme-challenge/ { root /var/www/certbot; } location / { return 301 https://$host$request_uri; } } server { listen 443 ssl; server_name spa.ddc.kittisak.com; ssl_certificate /etc/letsencrypt/live/spa.ddc.kittisak.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/spa.ddc.kittisak.com/privkey.pem; root /usr/share/nginx/html/ddc/spa; index index.html index.htm; location / { try_files $uri $uri/ /index.html; } location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { expires max; log_not_found off; } }