mirror of
https://github.com/genebean/dots.git
synced 2026-03-27 01:17:42 -04:00
Matrix works, Nginx is carrying the load
This commit is contained in:
parent
fac12b855e
commit
f3e75455b3
5 changed files with 66 additions and 36 deletions
|
|
@ -9,6 +9,7 @@ in {
|
|||
];
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
recommendedBrotliSettings = true;
|
||||
recommendedGzipSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
recommendedProxySettings = true;
|
||||
|
|
@ -21,40 +22,79 @@ in {
|
|||
}
|
||||
add_header Strict-Transport-Security $hsts_header;
|
||||
'';
|
||||
defaultListen = [
|
||||
{ port = https_port; addr = "0.0.0.0"; ssl = true; }
|
||||
{ port = https_port; addr = "[::]"; ssl = true; }
|
||||
];
|
||||
virtualHosts = {
|
||||
"hetznix01.${domain}" = {
|
||||
serverAliases = [
|
||||
"technicalissues.us"
|
||||
];
|
||||
default = true;
|
||||
enableACME = true;
|
||||
acmeRoot = null;
|
||||
forceSSL = true;
|
||||
locations = {
|
||||
"/" = {
|
||||
return = "301 https://beanbag.technicalissues.us";
|
||||
};
|
||||
"/.well-known/matrix/client" = {
|
||||
return = ''
|
||||
200 '{"m.homeserver": {"base_url": "https://matrix.technicalissues.us"}}'
|
||||
'';
|
||||
extraConfig = ''
|
||||
default_type application/json;
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
'';
|
||||
};
|
||||
"/.well-known/matrix/server" = {
|
||||
return = ''
|
||||
200 '{"m.server": "matrix.technicalissues.us"}'
|
||||
'';
|
||||
extraConfig = ''
|
||||
default_type application/json;
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
"matrix.${domain}" = {
|
||||
listen = [
|
||||
{ port = http_port; addr = "0.0.0.0"; }
|
||||
{ port = https_port; addr = "0.0.0.0"; ssl = true; }
|
||||
{ port = https_port; addr = "[::]"; ssl = true; }
|
||||
{ port = 8448; addr = "0.0.0.0"; ssl = true; }
|
||||
{ port = 8448; addr = "[::]"; ssl = true; }
|
||||
];
|
||||
enableACME = true;
|
||||
acmeRoot = null;
|
||||
addSSL = true;
|
||||
forceSSL = false;
|
||||
locations."/" = {
|
||||
return = "200 '<h1>Hello world ;)</h1>'";
|
||||
extraConfig = ''
|
||||
add_header Content-Type text/html;
|
||||
'';
|
||||
forceSSL = true;
|
||||
extraConfig = ''
|
||||
client_max_body_size 0;
|
||||
'';
|
||||
locations = {
|
||||
"/" = {
|
||||
return = "200 '<h1>Hi.</h1>'";
|
||||
extraConfig = ''
|
||||
add_header Content-Type text/html;
|
||||
'';
|
||||
};
|
||||
# Forward all Matrix API calls to the synapse Matrix homeserver. A trailing slash
|
||||
# *must not* be used here.
|
||||
"/_matrix".proxyPass = "http://[::1]:8008";
|
||||
# Forward requests for e.g. SSO and password-resets.
|
||||
"/_synapse/client".proxyPass = "http://[::1]:8008";
|
||||
};
|
||||
};
|
||||
"ot.${domain}" = {
|
||||
listen = [{ port = https_port; addr = "0.0.0.0"; ssl = true; }];
|
||||
enableACME = true;
|
||||
acmeRoot = null;
|
||||
forceSSL = true;
|
||||
basicAuthFile = config.sops.secrets.owntracks_basic_auth.path;
|
||||
locations = {
|
||||
# OwnTracks Frontend container
|
||||
"/" = {
|
||||
proxyPass = "http://127.0.0.1:8082";
|
||||
recommendedProxySettings = true;
|
||||
};
|
||||
};
|
||||
# OwnTracks Frontend container
|
||||
locations."/".proxyPass = "http://127.0.0.1:8082";
|
||||
};
|
||||
"recorder.${domain}" = {
|
||||
listen = [{ port = https_port; addr = "0.0.0.0"; ssl = true; }];
|
||||
enableACME = true;
|
||||
acmeRoot = null;
|
||||
forceSSL = true;
|
||||
|
|
@ -63,35 +103,28 @@ in {
|
|||
# OwnTracks Recorder
|
||||
"/" = {
|
||||
proxyPass = "http://127.0.0.1:8083";
|
||||
recommendedProxySettings = true;
|
||||
};
|
||||
"/pub" = { # Client apps need to point to this path
|
||||
extraConfig = "proxy_set_header X-Limit-U $remote_user;";
|
||||
proxyPass = "http://127.0.0.1:8083/pub";
|
||||
recommendedProxySettings = true;
|
||||
};
|
||||
"/static/" = {
|
||||
proxyPass = "http://127.0.0.1:8083/static/";
|
||||
recommendedProxySettings = true;
|
||||
};
|
||||
"/utils/" = {
|
||||
proxyPass = "http://127.0.0.1:8083/utils/";
|
||||
recommendedProxySettings = true;
|
||||
};
|
||||
"/view/" = {
|
||||
extraConfig = "proxy_buffering off;";
|
||||
proxyPass = "http://127.0.0.1:8083/view/";
|
||||
recommendedProxySettings = true;
|
||||
};
|
||||
"/ws" = {
|
||||
extraConfig = "rewrite ^/(.*) /$1 break;";
|
||||
proxyPass = "http://127.0.0.1:8083";
|
||||
recommendedProxySettings = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
"utk.${domain}" = {
|
||||
listen = [{ port = https_port; addr = "0.0.0.0"; ssl = true; }];
|
||||
enableACME = true;
|
||||
acmeRoot = null;
|
||||
forceSSL = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue