2024-02-26 17:21:14 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
tandoor = config.services.tandoor-recipes;
|
2024-11-20 20:32:38 +01:00
|
|
|
in
|
|
|
|
{
|
|
|
|
vHost =
|
|
|
|
if tandoor.enable then
|
|
|
|
{
|
2024-02-26 17:21:14 +01:00
|
|
|
extraConfig = ''
|
|
|
|
location /media/ {
|
|
|
|
alias ${tandoor.extraConfig.MEDIA_ROOT};
|
|
|
|
}
|
|
|
|
|
|
|
|
location / {
|
|
|
|
proxy_pass http://${tandoor.address}:${toString tandoor.port};
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_set_header REMOTE_ADDR $remote_addr;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
}
|
2024-11-20 20:32:38 +01:00
|
|
|
else
|
|
|
|
{ };
|
|
|
|
}
|
|
|
|
.vHost
|