- SRS/SDD/README/PROGRESS 统一将部署目标由"美国服务器"更正为"NAS 本机 + 甲骨文服务器反向代理"(此前已确认但未入库) - 新增 docker-compose.yml / nginx.conf / .env.example(对应待办任务4) - 相对 SDD 草稿的安全加固:one-api 端口改绑 127.0.0.1(原为公网端口映射),lobe-chat 不再发布主机端口,仅走容器内网
53 lines
1.4 KiB
Nginx Configuration File
53 lines
1.4 KiB
Nginx Configuration File
user nginx;
|
||
worker_processes auto;
|
||
|
||
error_log /var/log/nginx/error.log notice;
|
||
pid /var/run/nginx.pid;
|
||
|
||
events {
|
||
worker_connections 1024;
|
||
}
|
||
|
||
http {
|
||
include /etc/nginx/mime.types;
|
||
default_type application/octet-stream;
|
||
|
||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||
'$status $body_bytes_sent "$http_referer" '
|
||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||
|
||
access_log /var/log/nginx/access.log main;
|
||
|
||
sendfile on;
|
||
keepalive_timeout 65;
|
||
|
||
# 域名/IP 未确定前,先用 _ 通配 server_name(见 SDD 8.4 待确认事项)
|
||
server {
|
||
listen 443 ssl;
|
||
server_name _;
|
||
|
||
ssl_certificate /etc/nginx/certs/fullchain.pem;
|
||
ssl_certificate_key /etc/nginx/certs/privkey.pem;
|
||
|
||
location / {
|
||
proxy_pass http://lobe-chat:3210;
|
||
proxy_http_version 1.1;
|
||
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;
|
||
|
||
# 关闭缓冲/缓存以支持流式输出(SSE)
|
||
proxy_buffering off;
|
||
proxy_cache off;
|
||
proxy_read_timeout 300s;
|
||
}
|
||
}
|
||
|
||
server {
|
||
listen 80;
|
||
server_name _;
|
||
return 301 https://$host$request_uri;
|
||
}
|
||
}
|