การเข้าถึง SearXNG
- เปิดเบราว์เซอร์แล้วไปที่:
https://<SERVER_IP>/searxng - คาดว่าจะมีคำเตือน SSL จากเบราว์เซอร์ (self-signed certificate)
- ต้องมีการยืนยันตัวตน (Basic Auth popup)
- วิธียืนยันตัวตน: HTTP Basic Auth
- ข้อมูล credentials ถูกเก็บอย่างปลอดภัยใน:
/root/.cloudzy-creds
เส้นทางที่สำคัญ
- ไดเรกทอรี่การติดตั้ง:
/root/searxng - ไฟล์ Docker Compose:
/root/searxng/docker-compose.yml - ไฟล์ Env:
/root/searxng/.env - การกำหนดค่าหลัก:
/root/searxng/core-config/ - Nginx โฮสต์เสมือน:
/etc/nginx/sites-available/searxng - ไฟล์ Auth:
/etc/nginx/auth/searxng.htpasswd - ใบรับรอง TLS:
/etc/nginx/ssl/
เปิดใช้งาน SSL พร้อมโดเมน
1. ชี้โดเมนของคุณไปที่ IP ของเซิร์ฟเวอร์
2. แก้ไขไฟล์คอนฟิก Nginx และแทนที่ทั้งสองส่วน server_name <IP>; ด้วยโดเมนของคุณ (<your-domain>) สำหรับทั้งบล็อก HTTP (port 80) และ HTTPS (port 443):
vim /etc/nginx/sites-available/searxng
3. ติดตั้ง Certbot:
apt install -y certbot python3-certbot-nginx
4. รันคำสั่งต่อไปนี้เพื่อสร้างใบรับรอง Let's Encrypt ที่ถูกต้อง:
certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com
5. แทนที่พาธ SSL ในไฟล์คอนฟิก Nginx:
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. เปิดเบราว์เซอร์และไปที่: https://yourdomain.com
หมายเหตุ
- ปรับแต่งการตั้งค่า SearXNG ใน
/root/searxng/core-config/. - SearXNG รับการเชื่อมต่อที่ 127.0.0.1:8080 ภายใน
- Nginx ให้บริการ
/searxngแบบสาธารณะด้วย Basic Auth - Docker volumes เก็บข้อมูลหลักและแคช Valkey