style(web): moving global nginx configuration in web.nix
This commit is contained in:
parent
54080cfa18
commit
efc4d193fd
2 changed files with 18 additions and 9 deletions
|
|
@ -11,6 +11,20 @@ in
|
||||||
portefolio
|
portefolio
|
||||||
];
|
];
|
||||||
|
|
||||||
|
config = {
|
||||||
|
services.nginx = {
|
||||||
|
enable = true;
|
||||||
|
recommendedGzipSettings = true;
|
||||||
|
recommendedProxySettings = true;
|
||||||
|
};
|
||||||
|
security.acme = {
|
||||||
|
acceptTerms = true;
|
||||||
|
defaults.email = "raphael@parodi.pro";
|
||||||
|
certs = {
|
||||||
|
"raphael.parodi.pro" = {};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
options.service.web = {
|
options.service.web = {
|
||||||
portefolio = lib.mkOption {
|
portefolio = lib.mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
|
|
|
||||||
|
|
@ -22,24 +22,19 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
enable = true;
|
|
||||||
recommendedGzipSettings = true;
|
|
||||||
recommendedProxySettings = true;
|
|
||||||
virtualHosts."raphael.parodi.pro" = {
|
virtualHosts."raphael.parodi.pro" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
root = "/opt/portefolio/dist";
|
root = "/opt/portefolio/dist";
|
||||||
index = "index.html";
|
index = "index.html";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
try_files $uri /index.html;
|
try_files $uri /index.html;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
security.acme = {
|
security.acme = {
|
||||||
acceptTerms = true;
|
|
||||||
email = "raphael@parodi.pro";
|
|
||||||
certs = {
|
certs = {
|
||||||
"raphael.parodi.pro" = {};
|
"raphael.parodi.pro" = {};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue