-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx-ssl
64 lines (62 loc) · 2.1 KB
/
nginx-ssl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
security.acme = {
acceptTerms = true;
defaults = {
email = "your@email.com";
dnsProvider = "cloudflare";
dnsResolver = "1.1.1.1:53";
dnsPropagationCheck = true;
credentialsFile = "/etc/nixos/cloudflare.env";
# Use staging server.
# server = "https://acme-staging-v02.api.letsencrypt.org/directory";
};
};
services.nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts = {
# Hosted on domain.io
"nextcloud" = {
serverName = "domain.io";
enableACME = true;
acmeRoot = null; # Use DNS-01 Challenge.
forceSSL = true;
# listen = [{port = 443; addr="0.0.0.0"; ssl=true;}];
locations."/" = {proxyPass = "http://127.0.0.1:8080"; proxyWebsockets = true;};
extraConfig = "client_max_body_size 1000M;";
};
# Hosted on subdomains of domain.io
"books.domain.io" = {
enableACME = true;
acmeRoot = null; # Use DNS-01 Challenge.
forceSSL = true;
# listen = [{port = 443; addr="0.0.0.0"; ssl=true;}];
locations."/" = {proxyPass = "http://127.0.0.1:13378"; proxyWebsockets = true;};
};
"jellyfin.domain.io" = {
enableACME = true;
acmeRoot = null; # Use DNS-01 Challenge.
forceSSL = true;
# listen = [{port = 443; addr="0.0.0.0"; ssl=true;}];
locations."/" = {proxyPass = "http://127.0.0.1:8096"; proxyWebsockets = true;};
};
"plex.domain.io" = {
enableACME = true;
acmeRoot = null; # Use DNS-01 Challenge.
forceSSL = true;
# listen = [{port = 443; addr="0.0.0.0"; ssl=true;}];
locations."/" = {proxyPass = "http://127.0.0.1:32400"; proxyWebsockets = true;};
};
"code.domain.io" = {
enableACME = true;
acmeRoot = null; # Use DNS-01 Challenge.
forceSSL = true;
# listen = [{port = 443; addr="0.0.0.0"; ssl=true;}];
locations."/" = {proxyPass = "http://127.0.0.1:8444"; proxyWebsockets = true;};
};
# locations."/" = {proxyPass = "http://127.0.0.1:81"; proxyWebsockets = true;};
# };
};
};