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.

46 lines
1.2 KiB

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/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/snippets/ssl-params.conf;
  25. include /etc/nginx/snippets/secure-headers.conf;
  26. add_header Content-Security-Policy "
  27. default-src 'self';
  28. font-src 'self';
  29. style-src 'self';
  30. img-src 'self';
  31. base-uri 'self';
  32. form-action 'self';
  33. frame-ancestors 'self';
  34. ";
  35. @include('partials.default', ['domain' => $domain])
  36. @yield('server')
  37. }