a
This commit is contained in:
94
nginx.nix
94
nginx.nix
@@ -1,78 +1,48 @@
|
||||
{ pkgs, ... }: {
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
virtualHosts."kyren.codes" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
# useACMEHost = "kyren.codes";
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:3000";
|
||||
};
|
||||
};
|
||||
|
||||
virtualHosts."185.170.113.195" = {
|
||||
listen = [{
|
||||
addr = "0.0.0.0";
|
||||
port = 80;
|
||||
port = 3000;
|
||||
}];
|
||||
|
||||
locations."/" = {
|
||||
index = "index.html";
|
||||
root = "/srv/website";
|
||||
};
|
||||
|
||||
# locations."/404.html" = {
|
||||
# root = "/srv/website";
|
||||
# };
|
||||
# extraConfig = ''
|
||||
# error_page 404 /404.html;
|
||||
# '';
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
# security.acme = {
|
||||
# acceptTerms = true;
|
||||
# defaults.email = "kyren223@proton.me";
|
||||
# certs."kyren.codes" = {
|
||||
# extraDomainNames = [ "*.kyren.codes" ];
|
||||
# webroot = null;
|
||||
# dnsProvider = "cloudflare";
|
||||
# environmentFile = "${pkgs.writeText "cf-creds" ''
|
||||
# CF_DNS_API_TOKEN_FILE=/run/secrets/cloudflare-dns-api-token
|
||||
# ''}";
|
||||
# };
|
||||
# };
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
defaults.email = "kyren223@proton.me";
|
||||
certs."kyren.codes" = {
|
||||
extraDomainNames = [ "*.kyren.codes" ];
|
||||
webroot = null;
|
||||
dnsProvider = "cloudflare";
|
||||
environmentFile = "${pkgs.writeText "cf-creds" ''
|
||||
CF_DNS_API_TOKEN_FILE=/run/secrets/cloudflare-dns-api-token
|
||||
''}";
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 80 ];
|
||||
networking.firewall.allowedTCPPorts = [ 443 80 ];
|
||||
}
|
||||
# { pkgs, ... }: {
|
||||
# services.nginx = {
|
||||
# enable = true;
|
||||
# virtualHosts."kyren.codes" = {
|
||||
# forceSSL = true;
|
||||
# enableACME = true;
|
||||
# # useACMEHost = "kyren.codes";
|
||||
# locations."/" = {
|
||||
# proxyPass = "http://localhost:80";
|
||||
# };
|
||||
# };
|
||||
#
|
||||
# virtualHosts."185.170.113.195" = {
|
||||
# listen = [{
|
||||
# addr = "0.0.0.0";
|
||||
# port = 80;
|
||||
# }];
|
||||
#
|
||||
# locations."/" = {
|
||||
# index = "index.html";
|
||||
# root = "/srv/website";
|
||||
# };
|
||||
#
|
||||
# # locations."/404.html" = {
|
||||
# # root = "/srv/website";
|
||||
# # };
|
||||
# # extraConfig = ''
|
||||
# # error_page 404 /404.html;
|
||||
# # '';
|
||||
#
|
||||
# };
|
||||
# };
|
||||
#
|
||||
# security.acme = {
|
||||
# acceptTerms = true;
|
||||
# defaults.email = "kyren223@proton.me";
|
||||
# certs."kyren.codes" = {
|
||||
# extraDomainNames = [ "*.kyren.codes" ];
|
||||
# webroot = null;
|
||||
# dnsProvider = "cloudflare";
|
||||
# environmentFile = "${pkgs.writeText "cf-creds" ''
|
||||
# CF_DNS_API_TOKEN_FILE=/run/secrets/cloudflare-dns-api-token
|
||||
# ''}";
|
||||
# };
|
||||
# };
|
||||
#
|
||||
# networking.firewall.allowedTCPPorts = [ 443 80 ];
|
||||
# }
|
||||
|
||||
Reference in New Issue
Block a user