location PATHTOCHANGE { if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } try_files $uri @searx; } location @searx { uwsgi_pass unix:///tmp/searx.sock; include uwsgi_params; }