NGINX

This section explains how to set up a SearXNG instance using the HTTP server nginx. If you have used the Installation Script and do not have any special preferences you can install the SearXNG site using searxng.sh:

$ sudo -H ./utils/searxng.sh install nginx

If you have special interests or problems with setting up nginx, the following section might give you some guidance.

The nginx HTTP server

If nginx is not installed, install it now.

sudo -H apt-get install nginx

Now at http://localhost you should see a Welcome to nginx! page, on Fedora you see a Fedora Webserver - Test Page. The test page comes from the default nginx server configuration. How this default site is configured, depends on the linux distribution:

less /etc/nginx/nginx.conf

There is one line that includes site configurations from:

include /etc/nginx/sites-enabled/*;

NGINX’s SearXNG site

Now you have to create a configuration file (searxng.conf) for the SearXNG site. If nginx is new to you, the nginx beginners guide is a good starting point and the Getting Started wiki is always a good resource to keep in the pocket.

Depending on what your SearXNG installation is listening on, you need a http or socket communication to upstream.

The Installation Script installs the reference setup and a uWSGI setup that listens on a socket by default.

Create configuration at /etc/nginx/sites-available/ and place a symlink to sites-enabled:

sudo -H ln -s /etc/nginx/sites-available/searxng.conf \
              /etc/nginx/sites-enabled/searxng.conf

Restart services:

sudo -H systemctl restart nginx
sudo -H service uwsgi restart searxng

Disable logs

For better privacy you can disable nginx logs in /etc/nginx/nginx.conf.

http {
    # ...
    access_log /dev/null;
    error_log  /dev/null;
    # ...
}