This commit is contained in:
@@ -29,31 +29,16 @@ let
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Helper: standard proxy virtual host
|
|
||||||
mkProxy = port: {
|
mkProxy = port: {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://${upstream}:${toString port}";
|
proxyPass = "http://${upstream}:${toString port}";
|
||||||
|
proxyWebsockets = true;
|
||||||
extraConfig = "if ($fuckai) { return 444; }";
|
extraConfig = "if ($fuckai) { return 444; }";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Helper: proxy host with websocket support and extra location config
|
|
||||||
mkProxyWs = port: extraLocationConfig: {
|
|
||||||
enableACME = true;
|
|
||||||
forceSSL = true;
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://${upstream}:${toString port}";
|
|
||||||
proxyWebsockets = true;
|
|
||||||
extraConfig = ''
|
|
||||||
if ($fuckai) { return 444; }
|
|
||||||
${extraLocationConfig}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Helper: stream server block (TCP + UDP)
|
|
||||||
mkStream = port: ''
|
mkStream = port: ''
|
||||||
server {
|
server {
|
||||||
listen ${toString port};
|
listen ${toString port};
|
||||||
|
|||||||
Reference in New Issue
Block a user