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 = {
enable = true;
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 =
{ general.instance_name = "searxwell";
server.port = 8083;
server.base_url = "https://${config.var.hostname}/srx/";
# Replace DOI links with Sci-Hub
@ -289,6 +304,10 @@
};
};
# Allow nginx access to the uwsgi socket
users.groups."searx".members = [ "nginx" ];
### Reverse Proxy
services.nginx =
with config.var;
@ -340,14 +359,12 @@
};
# Searx instance
locations."/srx/" = {
proxyPass = "http://localhost:8083/";
extraConfig = ''
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Script-Name /srx/;
proxy_buffering off;
locations."/srx/".extraConfig =
''
include ${pkgs.nginx}/conf/uwsgi_params;
uwsgi_pass unix:/run/searx/uwsgi.sock;
'';
};
locations."/srx/static/".alias = "${pkgs.searx}/share/static/";
# Git server
locations."/git/".proxyPass = "http://localhost:3000/";
@ -371,7 +388,7 @@
# The Cactalogue
virtualHosts."cacta.bit" = {
locations."/".alias = "/home/giu/cactalogue/";
root = "/home/giu/cactalogue/";
extraConfig = disableLog;
};
};