Single-container navigation service combining: - Dashy dashboard + SearXNG metasearch + history sync API + admin WebUI - Go services for history/admin APIs, nginx as unified entry - Browser extensions (Chrome MV3 / Firefox MV2) with 30s batched sync - Production guide: portal-nginx unified auth reverse proxy + webui4frpc/frp tunnel - Fully sanitized (no internal IPs/domains/credentials)
88 lines
3.1 KiB
Nginx Configuration File
88 lines
3.1 KiB
Nginx Configuration File
worker_processes auto;
|
||
pid /run/nginx.pid;
|
||
error_log /var/log/nginx/error.log warn;
|
||
|
||
events {
|
||
worker_connections 1024;
|
||
}
|
||
|
||
http {
|
||
include /etc/nginx/mime.types;
|
||
default_type application/octet-stream;
|
||
sendfile on;
|
||
keepalive_timeout 65;
|
||
client_max_body_size 0;
|
||
gzip on;
|
||
gzip_types text/plain text/css application/json application/javascript text/xml;
|
||
|
||
# 全部服务通过统一 8080 端口对外
|
||
server {
|
||
listen 8080;
|
||
server_name _;
|
||
|
||
# Dashy 静态文件
|
||
root /app/dashy;
|
||
index index.html;
|
||
|
||
# ===== SearXNG 反向代理 =====
|
||
# SearXNG 路由是 /search(无尾斜杠),/search/ 会 404,故统一 rewrite 去掉尾斜杠。
|
||
# 结果页内静态资源/页面链接是绝对根路径(/static/、/preferences、/autocompleter 等)。
|
||
location ~ ^/search/?$ {
|
||
proxy_pass http://127.0.0.1:8888;
|
||
proxy_set_header Host $host;
|
||
proxy_set_header X-Real-IP $remote_addr;
|
||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
proxy_set_header X-Forwarded-Proto $scheme;
|
||
}
|
||
# SearXNG 静态资源(主题/前端脚本,页面上以 /static/... 绝对路径引用)
|
||
location /static/ {
|
||
proxy_pass http://127.0.0.1:8888;
|
||
proxy_set_header Host $host;
|
||
proxy_set_header X-Real-IP $remote_addr;
|
||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
proxy_set_header X-Forwarded-Proto $scheme;
|
||
}
|
||
# 其他 SearXNG 页面/接口(结果页内的链接会引用这些根路径)
|
||
location ~ ^/(autocompleter|preferences|stats|about|donate|opensearch.xml|image_proxy|translations)/? {
|
||
proxy_pass http://127.0.0.1:8888;
|
||
proxy_set_header Host $host;
|
||
proxy_set_header X-Real-IP $remote_addr;
|
||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
proxy_set_header X-Forwarded-Proto $scheme;
|
||
}
|
||
|
||
# History API(内部 3004)
|
||
location /api/history/ {
|
||
proxy_pass http://127.0.0.1:3004/;
|
||
proxy_set_header Host $host;
|
||
proxy_set_header X-Real-IP $remote_addr;
|
||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
proxy_set_header X-Forwarded-Proto $scheme;
|
||
}
|
||
|
||
# Admin WebUI(内部 3005)
|
||
location /admin/ {
|
||
proxy_pass http://127.0.0.1:3005/;
|
||
proxy_set_header Host $host;
|
||
proxy_set_header X-Real-IP $remote_addr;
|
||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
proxy_set_header X-Forwarded-Proto $scheme;
|
||
}
|
||
|
||
# conf.yml 由 nginx 直接提供(从 data volume 读取)
|
||
location = /conf.yml {
|
||
alias /app/data/conf.yml;
|
||
}
|
||
|
||
# item-icons 从 data volume 提供
|
||
location /item-icons/ {
|
||
alias /app/data/item-icons/;
|
||
}
|
||
|
||
# Dashy SPA 路由兜底
|
||
location / {
|
||
try_files $uri $uri/ /index.html;
|
||
}
|
||
}
|
||
}
|