Nginx: Difference between revisions

From NixOS Wiki
imported>Makefu
initial batch of nixos-users
 
imported>Fadenb
m Syntax highlighting
Line 3: Line 3:
Static blog with ssl enforced in <code>configuration.nix</code>
Static blog with ssl enforced in <code>configuration.nix</code>


<pre>services.nginx = {
<syntaxhighlight lang="nix">
services.nginx = {
   enable = true;
   enable = true;
   virtualHosts.&quot;blog.example.com&quot; = {
   virtualHosts."blog.example.com" = {
     enableSSL = true;
     enableSSL = true;
     enableACME = true;
     enableACME = true;
     forceSSL = true;
     forceSSL = true;
     root = &quot;/var/www/blog&quot;;
     root = "/var/www/blog";
   };
   };
};</pre>
}
</syntaxhighlight>

Revision as of 13:31, 27 August 2017

Sample setups

Static blog with ssl enforced in configuration.nix

services.nginx = {
  enable = true;
  virtualHosts."blog.example.com" = {
    enableSSL = true;
    enableACME = true;
    forceSSL = true;
    root = "/var/www/blog";
  };
}