<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Hosting SearXNG behind a VPN]]></title><description><![CDATA[<p dir="auto">If it helps others this was my config. To be honest I have a weak grasp of what it actually does so there might be some security issues with it.</p>
<p dir="auto">Apparently you can also add lemmy as a search engine. Will work on that later.</p>
<p dir="auto">::: spoiler config</p>
<pre><code># docker-compose.yml
name: searxng

services:
  core:
    container_name: searxng-core
    image: docker.io/searxng/searxng:latest
    restart: always
    network_mode: "service:gluetun"
    volumes:
      - ./core-config:/etc/searxng
      - core-data:/var/cache/searxng

  gluetun:
    image: qmcgaw/gluetun:v3.41.3
    container_name: gluetun
    cap_add:
      - NET_ADMIN
    environment:
      - VPN_SERVICE_PROVIDER=custom
      - VPN_TYPE=openvpn
      - OPENVPN_CUSTOM_CONFIG=/gluetun/custom.conf
    ports:
      - 8080:8080
    restart: always
    volumes:
      - ./gluetun:/gluetun
    devices:
      - /dev/net/tun:/dev/net/tun

  nginx:
    container_name: nginx
    image: nginx:latest
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./nginx:/etc/nginx/conf.d
      - ./cert:/etc/nginx/cert

  valkey:
    container_name: searxng-valkey
    image: docker.io/valkey/valkey:9-alpine
    command: valkey-server --save 30 1 --loglevel warning
    restart: always
    volumes:
      - valkey-data:/data/

volumes:
  core-data:
  valkey-data:

# nginx/default.conf
server {
  server_name localhost;
  listen 443 ssl;

  ssl_certificate /etc/nginx/cert/cert.pem;
  ssl_certificate_key /etc/nginx/cert/private.key;

  location / {
    proxy_pass http://gluetun:8080/;

    proxy_set_header   Host             $host;
    proxy_set_header   Connection       $http_connection;

    proxy_set_header   X-Forwarded-Proto $scheme;
    proxy_set_header   X-Real-IP        $remote_addr;
    proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
  }
}

server {
  server_name localhost;
  listen 80;
  location / {
    return 301 https://$host$request_uri;
  }
}
</code></pre>
<p dir="auto">:::</p>


<div class="row mt-3"><div class="col-12 mt-3"><img class="img-thumbnail" src="https://lemmy.today/pictrs/image/a61dcc03-8662-4bbd-bcd1-3c94c85a2962.avif" alt="Link Preview Image" /></div></div>]]></description><link>https://forum.ieu.app/topic/39c9cb07-8cda-4a06-a902-73dbe780625a/hosting-searxng-behind-a-vpn</link><generator>RSS for Node</generator><lastBuildDate>Sat, 05 Sep 2026 19:03:05 GMT</lastBuildDate><atom:link href="https://forum.ieu.app/topic/39c9cb07-8cda-4a06-a902-73dbe780625a.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 25 Aug 2026 21:17:04 GMT</pubDate><ttl>60</ttl></channel></rss>