This commit is contained in:
commit
30ce0dafc2
195 changed files with 8902 additions and 0 deletions
54
services/prosody/nginx.nix
Normal file
54
services/prosody/nginx.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (config.machine.prosody)
|
||||
enable
|
||||
domain
|
||||
;
|
||||
|
||||
localhost = "http://localhost:5280";
|
||||
in
|
||||
with lib; mkIf enable {
|
||||
security.acme.certs."${domain}".extraDomainNames = [
|
||||
"conference.${domain}"
|
||||
"upload.${domain}"
|
||||
];
|
||||
users.groups.acme.members = [
|
||||
"prosody"
|
||||
];
|
||||
services.nginx.virtualHosts = with lib; mkIf (domain != null) {
|
||||
"${domain}".locations = {
|
||||
"= /xmpp-websocket" = {
|
||||
proxyPass = localhost;
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
"= /http-bind".proxyPass = localhost;
|
||||
"/push".proxyPass = localhost;
|
||||
"= /.well-known/host-meta".proxyPass = localhost;
|
||||
"= /.well-known/host-meta.json".proxyPass = localhost;
|
||||
};
|
||||
"conference.${domain}" = {
|
||||
http3 = true;
|
||||
quic = true;
|
||||
forceSSL = true;
|
||||
kTLS = true;
|
||||
useACMEHost = domain;
|
||||
sslCertificate = "${config.security.acme.certs.${domain}.directory}/fullchain.pem";
|
||||
sslCertificateKey = "${config.security.acme.certs.${domain}.directory}/key.pem";
|
||||
locations."/".proxyPass = localhost;
|
||||
};
|
||||
"upload.${domain}" = {
|
||||
http3 = true;
|
||||
quic = true;
|
||||
forceSSL = true;
|
||||
kTLS = true;
|
||||
useACMEHost = domain;
|
||||
sslCertificate = "${config.security.acme.certs.${domain}.directory}/fullchain.pem";
|
||||
sslCertificateKey = "${config.security.acme.certs.${domain}.directory}/key.pem";
|
||||
locations."/".proxyPass = localhost;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue