configure searx on uWSGI

This commit is contained in:
Michele Guerini Rocco 2020-11-13 08:49:29 +01:00
parent 16c0713523
commit 12dbc17247
Signed by: rnhmjoj
GPG Key ID: BFBAF4C975F76450

View File

@ -266,9 +266,24 @@
services.searx = { services.searx = {
enable = true; enable = true;
environmentFile = config.secrets.searx.environment; environmentFile = config.secrets.searx.environment;
# Use nginx+uWSGI
runInUwsgi = true;
uwsgiConfig = {
disable-logging = true;
# serve via uwsgi unix socket
socket = "/run/searx/uwsgi.sock";
chmod-socket = "660";
# mount app on non-root url /srx
manage-script-name = true;
module = "";
mount = "/srx=searx.webapp:application";
};
settings = settings =
{ general.instance_name = "searxwell"; { general.instance_name = "searxwell";
server.port = 8083;
server.base_url = "https://${config.var.hostname}/srx/"; server.base_url = "https://${config.var.hostname}/srx/";
# Replace DOI links with Sci-Hub # Replace DOI links with Sci-Hub
@ -289,6 +304,10 @@
}; };
}; };
# Allow nginx access to the uwsgi socket
users.groups."searx".members = [ "nginx" ];
### Reverse Proxy ### Reverse Proxy
services.nginx = services.nginx =
with config.var; with config.var;
@ -340,15 +359,13 @@
}; };
# Searx instance # Searx instance
locations."/srx/" = { locations."/srx/".extraConfig =
proxyPass = "http://localhost:8083/"; ''
extraConfig = '' include ${pkgs.nginx}/conf/uwsgi_params;
proxy_set_header X-Scheme $scheme; uwsgi_pass unix:/run/searx/uwsgi.sock;
proxy_set_header X-Script-Name /srx/;
proxy_buffering off;
''; '';
}; locations."/srx/static/".alias = "${pkgs.searx}/share/static/";
# Git server # Git server
locations."/git/".proxyPass = "http://localhost:3000/"; locations."/git/".proxyPass = "http://localhost:3000/";
@ -371,7 +388,7 @@
# The Cactalogue # The Cactalogue
virtualHosts."cacta.bit" = { virtualHosts."cacta.bit" = {
locations."/".alias = "/home/giu/cactalogue/"; root = "/home/giu/cactalogue/";
extraConfig = disableLog; extraConfig = disableLog;
}; };
}; };