<li><p><aclass="reference external"href="https://docs.nginx.com/nginx/admin-guide/web-server/web-server/#setting-up-virtual-servers">nginx server configuration</a></p></li>
<li><p><aclass="reference external"href="https://www.nginx.com/resources/wiki/start/">Getting Started wiki</a></p></li>
<li><p><aclass="reference external"href="https://uwsgi-docs.readthedocs.io/en/latest/Nginx.html">uWSGI support from nginx</a></p></li>
<h2><aclass="toc-backref"href="#id1">The nginx HTTP server</a><aclass="headerlink"href="#the-nginx-http-server"title="Permalink to this headline">¶</a></h2>
<p>If <aclass="reference external"href="https://docs.nginx.com/nginx/admin-guide/">nginx</a> is not installed (uwsgi will not work with the package nginx-light),
<p>Now at <aclass="reference external"href="http://localhost">http://localhost</a> you should see a <em>Welcome to nginx!</em> page, on Fedora you
see a <em>Fedora Webserver - Test Page</em>. The test page comes from the default
<aclass="reference external"href="https://docs.nginx.com/nginx/admin-guide/web-server/web-server/#setting-up-virtual-servers">nginx server configuration</a>. How this default intro site is configured,
<spanid="nginx-searx-site"></span><h2><aclass="toc-backref"href="#id2">A nginx searx site</a><aclass="headerlink"href="#a-nginx-searx-site"title="Permalink to this headline">¶</a></h2>
<divclass="sidebar">
<pclass="sidebar-title">public to the internet?</p>
<p>If your searx instance is public, stop here and first install <aclass="reference internal"href="../utils/filtron.sh.html#filtron-sh"><spanclass="std std-ref">filtron
reverse proxy</span></a> and <aclass="reference internal"href="../utils/morty.sh.html#morty-sh"><spanclass="std std-ref">result proxy morty</span></a>, see
<aclass="reference internal"href="installation.html#installation-scripts"><spanclass="std std-ref">Installation scripts</span></a>. If already done, follow setup: <em>searx via
filtron plus morty</em>.</p>
</div>
<p>Now you have to create a configuration for the searx site. If <aclass="reference external"href="https://docs.nginx.com/nginx/admin-guide/">nginx</a> is new to
you, the <aclass="reference external"href="https://nginx.org/en/docs/beginners_guide.html">nginx beginners guide</a> is a good starting point and the <aclass="reference external"href="https://www.nginx.com/resources/wiki/start/">Getting
<divaria-label="Tabbed content"role="tablist"><buttonaria-controls="panel-2-VWJ1bnR1IC8gZGViaWFu"aria-selected="true"class="sphinx-tabs-tab group-tab"id="tab-2-VWJ1bnR1IC8gZGViaWFu"name="VWJ1bnR1IC8gZGViaWFu"role="tab"tabindex="0">Ubuntu / debian</button><buttonaria-controls="panel-2-QXJjaCBMaW51eA=="aria-selected="false"class="sphinx-tabs-tab group-tab"id="tab-2-QXJjaCBMaW51eA=="name="QXJjaCBMaW51eA=="role="tab"tabindex="-1">Arch Linux</button><buttonaria-controls="panel-2-RmVkb3JhIC8gUkhFTA=="aria-selected="false"class="sphinx-tabs-tab group-tab"id="tab-2-RmVkb3JhIC8gUkhFTA=="name="RmVkb3JhIC8gUkhFTA=="role="tab"tabindex="-1">Fedora / RHEL</button></div><divaria-labelledby="tab-2-VWJ1bnR1IC8gZGViaWFu"class="sphinx-tabs-panel group-tab"id="panel-2-VWJ1bnR1IC8gZGViaWFu"name="VWJ1bnR1IC8gZGViaWFu"role="tabpanel"tabindex="0"><p>Create configuration at <codeclass="docutils literal notranslate"><spanclass="pre">/etc/nginx/sites-available/searx</span></code> and place a
</div><divaria-labelledby="tab-2-RmVkb3JhIC8gUkhFTA=="class="sphinx-tabs-panel group-tab"hidden="true"id="panel-2-RmVkb3JhIC8gUkhFTA=="name="RmVkb3JhIC8gUkhFTA=="role="tabpanel"tabindex="0"><p>Create configuration at <codeclass="docutils literal notranslate"><spanclass="pre">/etc/nginx/conf.d/searx</span></code> and place a
<divaria-label="Tabbed content"role="tablist"><buttonaria-controls="panel-3-c2VhcnggdmlhIGZpbHRyb24gcGx1cyBtb3J0eQ=="aria-selected="true"class="sphinx-tabs-tab group-tab"id="tab-3-c2VhcnggdmlhIGZpbHRyb24gcGx1cyBtb3J0eQ=="name="c2VhcnggdmlhIGZpbHRyb24gcGx1cyBtb3J0eQ=="role="tab"tabindex="0">searx via filtron plus morty</button><buttonaria-controls="panel-3-cHJveHkgb3IgdVdTR0k="aria-selected="false"class="sphinx-tabs-tab group-tab"id="tab-3-cHJveHkgb3IgdVdTR0k="name="cHJveHkgb3IgdVdTR0k="role="tab"tabindex="-1">proxy or uWSGI</button><buttonaria-controls="panel-3-XC5cLiBhdCBzdWJkaXIgVVJM"aria-selected="false"class="sphinx-tabs-tab group-tab"id="tab-3-XC5cLiBhdCBzdWJkaXIgVVJM"name="XC5cLiBhdCBzdWJkaXIgVVJM"role="tab"tabindex="-1">.. at subdir URL</button></div><divaria-labelledby="tab-3-c2VhcnggdmlhIGZpbHRyb24gcGx1cyBtb3J0eQ=="class="sphinx-tabs-panel group-tab"id="panel-3-c2VhcnggdmlhIGZpbHRyb24gcGx1cyBtb3J0eQ=="name="c2VhcnggdmlhIGZpbHRyb24gcGx1cyBtb3J0eQ=="role="tabpanel"tabindex="0"><p>Use this setup, if your instance is public to the internet, compare
figure: <aclass="reference internal"href="architecture.html#arch-public"><spanclass="std std-ref">architecture</span></a> and <aclass="reference internal"href="installation.html#installation-scripts"><spanclass="std std-ref">Installation scripts</span></a>.</p>
<olclass="arabic simple">
<li><p>Configure a reverse proxy for <aclass="reference internal"href="../utils/filtron.sh.html#filtron-sh"><spanclass="std std-ref">filtron</span></a>, listening on
<em>localhost 4004</em> (<aclass="reference internal"href="filtron.html#filtron-route-request"><spanclass="std std-ref">Route request through filtron</span></a>):</p></li>
<p>For a fully result proxification add <aclass="reference internal"href="morty.html#searx-morty"><spanclass="std std-ref">morty’s</span></a><strong>public
URL</strong> to your <aclass="reference external"href="https://github.com/searx/searx/blob/master/searx/settings.yml">git://searx/settings.yml</a>:</p>
</div><divaria-labelledby="tab-3-cHJveHkgb3IgdVdTR0k="class="sphinx-tabs-panel group-tab"hidden="true"id="panel-3-cHJveHkgb3IgdVdTR0k="name="cHJveHkgb3IgdVdTR0k="role="tabpanel"tabindex="0"><p>Be warned, with this setup, your instance isn’t <aclass="reference internal"href="filtron.html#searx-filtron"><spanclass="std std-ref">protected</span></a>. Nevertheless it is good enough for intranet usage and it is a
excellent example of; <em>how different services can be set up</em>. The next
example shows a reverse proxy configuration wrapping the <aclass="reference internal"href="installation-uwsgi.html#uwsgi-configuration"><spanclass="std std-ref">searx-uWSGI
application</span></a>, listening on <codeclass="docutils literal notranslate"><spanclass="pre">http</span><spanclass="pre">=</span>
<p>Alternatively you can use the <aclass="reference external"href="https://uwsgi-docs.readthedocs.io/en/latest/Nginx.html">uWSGI support from nginx</a> via unix
sockets. For socket communication, you have to activate <codeclass="docutils literal notranslate"><spanclass="pre">socket</span><spanclass="pre">=</span>
<spanclass="pre">/run/uwsgi/app/searx/socket</span></code> and comment out the <codeclass="docutils literal notranslate"><spanclass="pre">http</span><spanclass="pre">=</span>
<spanclass="pre">127.0.0.1:8888</span></code> configuration in your <aclass="reference internal"href="installation-uwsgi.html#uwsgi-configuration"><spanclass="std std-ref">uwsgi ini file</span></a>.</p>
<p>The example shows a nginx virtual <codeclass="docutils literal notranslate"><spanclass="pre">server</span></code> configuration, listening on
port 80 (IPv4 and IPv6 <aclass="reference external"href="http://[::]:80">http://[::]:80</a>). The uWSGI app is configured at
location <codeclass="docutils literal notranslate"><spanclass="pre">/</span></code> by importing the <aclass="reference external"href="https://uwsgi-docs.readthedocs.io/en/latest/Nginx.html#configuring-nginx">uwsgi_params</a> and passing requests to
the uWSGI socket (<codeclass="docutils literal notranslate"><spanclass="pre">uwsgi_pass</span></code>). The <codeclass="docutils literal notranslate"><spanclass="pre">server</span></code>'s root points to the
</div><divaria-labelledby="tab-3-XC5cLiBhdCBzdWJkaXIgVVJM"class="sphinx-tabs-panel group-tab"hidden="true"id="panel-3-XC5cLiBhdCBzdWJkaXIgVVJM"name="XC5cLiBhdCBzdWJkaXIgVVJM"role="tabpanel"tabindex="0"><p>Be warned, with these setups, your instance isn’t <aclass="reference internal"href="filtron.html#searx-filtron"><spanclass="std std-ref">protected</span></a>. The examples are just here to demonstrate how to export the
<p>The <codeclass="docutils literal notranslate"><spanclass="pre">X-Script-Name</span><spanclass="pre">/searx</span></code> is needed by the searx implementation to
calculate relative URLs correct. The next example shows a uWSGI
configuration. Since there are no HTTP headers in a (u)WSGI protocol, the
value is shipped via the <aclass="reference external"href="https://werkzeug.palletsprojects.com/en/1.0.x/wsgi/#werkzeug.wsgi.get_script_name">SCRIPT_NAME</a> in the WSGI environment.</p>
<h2><aclass="toc-backref"href="#id3">Disable logs</a><aclass="headerlink"href="#disable-logs"title="Permalink to this headline">¶</a></h2>
<p>For better privacy you can disable nginx logs in <codeclass="docutils literal notranslate"><spanclass="pre">/etc/nginx/nginx.conf</span></code>.</p>