Change host

searx vhost still not working
This commit is contained in:
muon 2024-12-01 10:22:10 +00:00
parent 784c5dfdad
commit 4b3808c042
6 changed files with 71 additions and 53 deletions

View file

@ -2,36 +2,39 @@
let
inherit (lib) types mkOption mkEnableOption;
cfg = config.mods.server.search;
port = 8081;
in {
options.mods.server.search = {
enable = mkEnableOption {
default = false;
description = "enables search engine server";
};
port = mkOption {
type = types.port;
default = 8081;
};
nginx = mkOption {
type = types.nullOr types.str;
default = "search";
};
};
config = {
# mods.server.nginx.ports.search = port;
services.nginx.virtualHosts."search.muon.host" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://10.0.0.3:${toString port}";
proxyWebsockets = true; # needed if you need to use WebSocket
extraConfig =
# required when the server wants to use HTTP Authentication
"proxy_pass_header Authorization;";
};
};
services.searx = lib.mkIf cfg.enable {
enable = true;
runInUwsgi = true;
uwsgiConfig = {
disable-logging = true;
http = ":${toString cfg.port}";
};
# runInUwsgi = true;
# uwsgiConfig = {
# disable-logging = true;
# http = ":${toString port}";
# };
settings = {
server.port = cfg.port;
server.port = port;
server.bind_address = "0.0.0.0";
server.secret_key = "temporary-before-sops";
@ -43,6 +46,5 @@ in {
};
};
};
};
}