การเข้าถึง SearXNG
- เปิด browser และไปที่:
https://<SERVER_IP>/searxng - คาดว่าจะมีคำเตือน SSL ของ browser (self-signed certificate)
- จำเป็นต้องมีการตรวจสอบสิทธิ์ (ป๊อปอัปการตรวจสอบสิทธิ์พื้นฐาน)
- วิธีการรับรองความถูกต้อง: HTTP Basic Auth
- ข้อมูลเข้าสู่ระบบจะเก็บไว้อย่างปลอดภัยใน:
/root/.cloudzy-creds
Path ที่สำคัญ
- ไดเรกทอรีติดตั้ง:
/root/searxng - ไฟล์ Docker Compose:
/root/searxng/docker-compose.yml - ไฟล์ Env:
/root/searxng/.env - การกำหนดค่าหลัก:
/root/searxng/core-config/ - Nginx vhost:
/etc/nginx/sites-available/searxng - ไฟล์รับรองความถูกต้อง:
/etc/nginx/auth/searxng.htpasswd - ใบรับรอง TLS:
/etc/nginx/ssl/
เปิดใช้งาน SSL กับโดเมน
1. ชี้โดเมนของคุณไปยัง IP ของ server
2. แก้ไข config ของ Nginx และเปลี่ยนทั้งคู่ server_name <IP>; กับโดเมนของคุณ (<your-domain>) สำหรับทั้ง HTTP (port 80) และ HTTPS (port 443) blocks:
vim /etc/nginx/sites-available/searxng
3. ติดตั้ง Certbot:
apt install -y certbot python3-certbot-nginx
4. รันคำสั่งต่อไปนี้เพื่อสร้าง Let’s Encrypt certificate ที่ใช้ได้:
certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com
5. แทนที่ SSL paths ใน Nginx config:
vim /etc/nginx/sites-available/searxng
# Before:
# ssl_certificate /etc/nginx/ssl/fullchain.pem;
# ssl_certificate_key /etc/nginx/ssl/privkey.pem;
# After:
# ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
6. รีสตาร์ท Nginx เพื่อใช้การเปลี่ยนแปลง:
systemctl restart nginx
7. เปิด browser และไปที่: https://yourdomain.com
หมายเหตุ
- ปรับแต่งการตั้งค่า SearXNG ใน
/root/searxng/core-config/. - SearXNG ฟัง 127.0.0.1:8080 ภายใน
- Nginx ทำหน้าที่
/searxngต่อสาธารณะด้วย Basic Auth - ไดรฟ์ข้อมูลDockerยังคงมีข้อมูลหลักและแคช Valkey