OpenSource CLI-App to install and handle stuff related to Web-Server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1003 B

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. server {
  2. listen 80;
  3. listen [::]:80;
  4. server_name {{ $domain }}@if ($redirect_www) www.{{ $domain }}@endif;
  5. return 301 https://{{ $domain }}$request_uri;
  6. }
  7. @if ($redirect_www)
  8. server {
  9. listen 443 ssl http2;
  10. listen [::]:443 ssl http2;
  11. ssl_certificate /etc/letsencrypt/live/www.{{ $domain }}/fullchain.pem;
  12. ssl_certificate_key /etc/letsencrypt/live/www.{{ $domain }}/privkey.pem;
  13. include /etc/nginx/snippets/ssl-params.conf;
  14. include /etc/nginx/snippets/secure-headers.conf;
  15. server_name www.{{ $domain }};
  16. return 301 https://{{ $domain }}$request_uri;
  17. }
  18. @endif
  19. server {
  20. listen 443 ssl http2;
  21. listen [::]:443 ssl http2;
  22. ssl_certificate /etc/letsencrypt/live/{{ $domain }}/fullchain.pem;
  23. ssl_certificate_key /etc/letsencrypt/live/{{ $domain }}/privkey.pem;
  24. include /etc/nginx/snippets/ssl-params.conf;
  25. include /etc/nginx/snippets/secure-headers.conf;
  26. @include('partials.default', ['domain' => $domain])
  27. @yield('server')
  28. }