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.

43 lines
1.1 KiB

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