Fix media files
Let gunicorn deliver the media files. This is a workaround until I figured out how to give nginx the permissions to deliver them.
This commit is contained in:
parent
82817c32ef
commit
8a7765f4e2
1 changed files with 16 additions and 2 deletions
|
|
@ -3,6 +3,7 @@
|
|||
let
|
||||
domain = "tandoor.jalr.de";
|
||||
cfg = config.services.tandoor-recipes;
|
||||
#recipesDirectory = "/var/lib/private/tandoor-recipes/recipes";
|
||||
inherit (config.networking) ports;
|
||||
in
|
||||
{
|
||||
|
|
@ -13,6 +14,9 @@ in
|
|||
services.tandoor-recipes = {
|
||||
enable = true;
|
||||
port = ports.tandoor.tcp;
|
||||
extraConfig = {
|
||||
GUNICORN_MEDIA = "1";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.tandoor-recipes = {
|
||||
|
|
@ -26,12 +30,22 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
#users.groups.tandoor-recipes.members = [ "nginx" ];
|
||||
# https://tandoor.jalr.de/media/recipes/c071286f-60b3-45e9-9ac5-f4bb99703c17_11.jpg
|
||||
|
||||
#systemd.services.nginx.serviceConfig.BindReadOnlyPaths = [ recipesDirectory ];
|
||||
#users.groups.tandoor-recipes.members = [ "nginx" ];
|
||||
|
||||
services.nginx.virtualHosts."${domain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${toString cfg.port}";
|
||||
locations = {
|
||||
"/" = {
|
||||
proxyPass = "http://127.0.0.1:${toString cfg.port}";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
#"/media/recipes/".alias = recipesDirectory;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue