1
0

monoexp.com.conf 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # /etc/nginx/vhosts.d/monoexp.com.conf
  2. #
  3. # monoexp.com is canonical; www.monoexp.com redirects to it.
  4. # Port 80 (ACME challenges and the HTTP->HTTPS redirect) is already handled
  5. # by the `.monoexp.com` block in 00-default.conf, which matches the apex too.
  6. #
  7. # Certificate: one cert named "monoexp-home" covering both names. The
  8. # issue-cert wrapper only accepts subdomains, so issue it directly as bajdev:
  9. # sudo certbot certonly --webroot -w /srv/www/acme --cert-name monoexp-home \
  10. # -d monoexp.com -d www.monoexp.com --deploy-hook 'systemctl reload nginx'
  11. # www -> apex
  12. server {
  13. listen 443 ssl; listen [::]:443 ssl;
  14. server_name www.monoexp.com;
  15. ssl_certificate /etc/letsencrypt/live/monoexp-home/fullchain.pem;
  16. ssl_certificate_key /etc/letsencrypt/live/monoexp-home/privkey.pem;
  17. include snippets/tls-common.conf;
  18. return 301 https://monoexp.com$request_uri;
  19. }
  20. # apex: the home page
  21. server {
  22. listen 443 ssl; listen [::]:443 ssl;
  23. server_name monoexp.com;
  24. ssl_certificate /etc/letsencrypt/live/monoexp-home/fullchain.pem;
  25. ssl_certificate_key /etc/letsencrypt/live/monoexp-home/privkey.pem;
  26. include snippets/tls-common.conf;
  27. root /srv/www/vhosts/monoexp.com;
  28. index index.html;
  29. location / { try_files $uri $uri/ =404; }
  30. # Short cache for the stylesheet and icon; HTML keeps nginx's defaults.
  31. location ~* \.(css|svg)$ { expires 1h; }
  32. }