send nginx log to journal
Some checks failed
Test Nix flake / Test nix flake (push) Has been cancelled
Some checks failed
Test Nix flake / Test nix flake (push) Has been cancelled
This commit is contained in:
parent
14fe8e912e
commit
6022b14de8
1 changed files with 46 additions and 26 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
let
|
||||
cfg = config.services.hedgedoc.settings;
|
||||
fqdn = "md.${config.networking.domain}";
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
|
|
@ -14,7 +15,7 @@ in
|
|||
enable = true;
|
||||
environmentFile = config.age.secrets.hedgedoc_db_password.path;
|
||||
settings = {
|
||||
domain = "md.${config.networking.domain}";
|
||||
domain = fqdn;
|
||||
dbURL = "postgres://hedgedoc:\${DB_PASSWORD}@sql.berlin.ccc.de:5432/hedgedoc";
|
||||
db.dialect = "postgresql";
|
||||
protocolUseSSL = true;
|
||||
|
|
@ -24,28 +25,29 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
nginx.virtualHosts."md.${config.networking.domain}" = {
|
||||
nginx.virtualHosts.${fqdn} = {
|
||||
default = true;
|
||||
quic = true;
|
||||
kTLS = true;
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
extraConfig = ''
|
||||
proxy_set_header Forwarded "$proxy_forwarded_for_element;$proxy_forwarded_by_element;host=$host;proto=$scheme";
|
||||
error_log syslog:server=unix:/dev/log,tag=${builtins.replaceStrings [ "." ] [ "_" ] fqdn} warn;
|
||||
access_log syslog:server=unix:/dev/log vhost_combined;
|
||||
'';
|
||||
locations = {
|
||||
"/" = {
|
||||
proxyPass = "http://${cfg.host}:${toString cfg.port}";
|
||||
recommendedProxySettings = true;
|
||||
extraConfig = ''
|
||||
add_header Content-Security-Policy "frame-src 'self'; default-src 'self'; script-src 'self'; img-src 'self'; style-src 'self' 'unsafe-inline'; font-src 'self'; form-action 'self'; upgrade-insecure-requests;" always;
|
||||
proxy_set_header Forwarded "$proxy_forwarded_for_element;$proxy_forwarded_by_element;host=$host;proto=$scheme";
|
||||
'';
|
||||
};
|
||||
"/socket.io/" = {
|
||||
proxyPass = "http://${cfg.host}:${toString cfg.port}";
|
||||
proxyWebsockets = true;
|
||||
recommendedProxySettings = true;
|
||||
extraConfig = ''
|
||||
proxy_set_header Forwarded "$proxy_forwarded_for_element;$proxy_forwarded_by_element;host=$host;proto=$scheme";
|
||||
'';
|
||||
};
|
||||
"/metrics" = {
|
||||
proxyPass = "http://${cfg.host}:${toString cfg.port}";
|
||||
|
|
|
|||
Loading…
Reference in a new issue