2019-06-22 23:58:08 +02:00
|
|
|
{ config, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
vHost = if config.services.nix-serve.enable then {
|
|
|
|
extraConfig = ''
|
|
|
|
location / {
|
|
|
|
proxy_pass http://${config.services.nix-serve.bindAddress}:${toString config.services.nix-serve.port};
|
2019-10-06 18:30:47 +02:00
|
|
|
proxy_set_header Host $host;
|
2019-06-22 23:58:08 +02:00
|
|
|
proxy_set_header REMOTE_ADDR $remote_addr;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_set_header X-Forwarded-Proto https;
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
} else {};
|
|
|
|
}.vHost
|