splitted nginx logs

This commit is contained in:
mc-fucker 2022-10-30 15:51:48 +01:00
parent 9e9d1c0326
commit cd84c425d6
4 changed files with 18 additions and 5 deletions

View file

@ -2,15 +2,20 @@
let
port = "8000";
db = "ihatemoney";
domain = "geld.mc-fucker.cool";
in
{
services.nginx.enable = true;
services.nginx.virtualHosts."geld.mc-fucker.cool" = {
services.nginx.virtualHosts."${domain}" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:${port}";
};
extraConfig = ''
access_log /var/log/nginx/${domain}_access.log;
error_log /var/log/nginx/${domain}_error.log;
'';
};
security.acme = {
@ -19,7 +24,7 @@ in
};
virtualisation.oci-containers.containers.ihatemoney = {
image = "e0f5c301fa0c";
image = "e867068a7f61";
environment = {
ACTIVATE_ADMIN_DASHBOARD = "True";
ACTIVATE_DEMO_PROJECT = "False";

View file

@ -21,6 +21,8 @@ in
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_headers_hash_bucket_size 64;
access_log /var/log/nginx/${domain}_access.log;
error_log /var/log/nginx/${domain}_error.log;
'';
locations = {
"/" = {

View file

@ -52,9 +52,11 @@ in
"/" = {
proxyPass = "http://127.0.0.1:${tandoor_port}";
extraConfig = ''
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect http://127.0.0.1:${tandoor_port} https://${domain};
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect http://127.0.0.1:${tandoor_port} https://${domain};
access_log /var/log/nginx/${domain}_access.log;
error_log /var/log/nginx/${domain}_error.log;
'';
};

View file

@ -56,6 +56,10 @@ in
locations."/" = {
proxyPass = "http://localhost:${port}";
};
extraConfig = ''
access_log /var/log/nginx/${domain}_access.log;
error_log /var/log/nginx/${domain}_error.log;
'';
};
}