improve hedhedoc
This commit is contained in:
parent
0b041cc949
commit
7cbd49fe42
5 changed files with 88 additions and 90 deletions
44
hosts/md/nginx.nix
Normal file
44
hosts/md/nginx.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.services.hedgedoc.settings;
|
||||
in
|
||||
{
|
||||
services.nginx.virtualHosts."${config.networking.hostName}.${config.networking.domain}" = {
|
||||
default = true;
|
||||
quic = true;
|
||||
kTLS = true;
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations = {
|
||||
"/" = {
|
||||
recommendedProxySettings = true;
|
||||
proxyPass = "http://${cfg.host}:${toString cfg.port}";
|
||||
};
|
||||
"/socket.io/" = {
|
||||
recommendedProxySettings = true;
|
||||
proxyWebsockets = true;
|
||||
proxyPass = "http://${cfg.host}:${toString cfg.port}";
|
||||
};
|
||||
"/metrics" = {
|
||||
recommendedProxySettings = true;
|
||||
proxyPass = "http://${cfg.host}:${toString cfg.port}";
|
||||
extraConfig = ''
|
||||
allow 195.160.173.14;
|
||||
allow 2001:678:760:cccb::14;
|
||||
deny all;
|
||||
'';
|
||||
};
|
||||
"/status" = {
|
||||
recommendedProxySettings = true;
|
||||
proxyPass = "http://${cfg.host}:${toString cfg.port}";
|
||||
extraConfig = ''
|
||||
allow 195.160.173.14;
|
||||
allow 2001:678:760:cccb::14;
|
||||
deny all;
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue