server { listen 80; server_name copyninja.info www.copyninja.info; #redirect all traffic to https return 301 https://$server_name$request_uri; } server { listen 443 ssl; server_name copyninja.info www.copyninja.info; ssl on; ssl_certificate /etc/letsencrypt/live/copyninja.info-0001/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/copyninja.info-0001/privkey.pem; include /etc/nginx/conf.d/ssl.conf; root /srv/copyninja.info/; index index.html index.htm; # Caching static files location ~* \.(?:ico|css|js|gif|jpe?g|png)$ { expires 30d; add_header Pragma public; add_header Cache-Control "public"; } # allow letsencrypt location ~ /.well-known { allow all; } try_files $uri $uri/index.html $uri.html =404; }