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