Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

Page not found with searx 0.14, python3 and uwsgi+nginx in subdirectory #1337

Closed
dadosch opened this issue Jun 28, 2018 · 1 comment
Closed

Comments

@dadosch
Copy link
Contributor

dadosch commented Jun 28, 2018

I installed searx like described at https://asciimoo.github.io/searx/dev/install/installation.html#id4 but decided to use python3. For that I installed uwsgi-plugin-python3. Without callable = app in searx.ini it wouldn't start. Now it starts, but the main page /searx as well as /searx/static/[anystatic] throw a 404.

The log says when requesting statics that they are getting generated....
localhost:8888 works fine when starting manually with python searx/webapp.py

I think this is a configuration issue, but after searching for hours I couldn't solve it and I am out of ideas 😢

I am aware of #686, but there only Apache seems to be used.

settings.yml

...
server:
    base_url : "https://my.server/searx/"
...

searx.ini

[uwsgi]
# Who will run the code
uid = searx
gid = searx

# disable logging for privacy
disable-logging = false

# Number of workers (usually CPU count)
workers = 4

# The right granted on the created socket
chmod-socket = 666

# Plugin to use and interpretor config
single-interpreter = true
master = true
# python3, also installed the uwsgi plugin
plugin = python3
lazy-apps = true
enable-threads = true

# Module to import
module = searx.webapp

# Virtualenv and python path
base = /srv/searx
virtualenv = /srv/searx/searx-ve/
pythonpath = /srv/searx/
chdir = /srv/searx/searx/

static-map = /static=/srv/searx/searx/static

# without the following I couldn't get it to run
callable = app

nginx config

...
    location = /searx {
        rewrite ^ /searx/;
    }
    location /searx {
        try_files $uri @searx;
    }
    location @searx {
        uwsgi_param SCRIPT_NAME /searx;
        include uwsgi_params;
        uwsgi_modifier1 30;
        uwsgi_pass unix:/run/uwsgi/app/searx/socket;
    }
...
@dadosch
Copy link
Contributor Author

dadosch commented Jun 28, 2018

It works! For nginx you need to add
rewrite ^/searx(/.*)$ $1 break; to the location /searx/ block. The static files I am serving with nginx for now.

    location = /searx {
        rewrite ^ /searx/;
    }

location /searx/static/ {
        rewrite ^/searx/static(/.*)$ $1 break;
        root /srv/searx/searx/static;
}
    location /searx/ {
        rewrite ^/searx(/.*)$ $1 break;
        try_files $uri @searx;
    }
    location @searx {
        uwsgi_param SCRIPT_NAME /searx;
        include uwsgi_params;
        uwsgi_modifier1 30;
        uwsgi_pass unix:/run/uwsgi/app/searx/socket;
    }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants