docker: nginx listens on 80 and 8890, backend moves to internal 8891

Deploy platforms that route to the container's exposed/compose port
(8890) were hitting the fun backend directly, which 404s unmatched
GET paths. Now nginx answers on both ports so either routing lands
on the SPA/API proxy layer.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
2026-10-08 16:57:46 +08:00
co-authored by Devin
parent ee65242a7a
commit e2ba38a0c7
4 changed files with 10 additions and 9 deletions
+2 -2
View File
@@ -25,9 +25,9 @@ COPY docker/nginx.conf /etc/nginx/http.d/default.conf
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh && mkdir -p /app/data
ENV CYIBOX_PORT=8890 \
ENV CYIBOX_PORT=8891 \
CYIBOX_DB=/app/data/cyibox.db
EXPOSE 80
EXPOSE 80 8890
VOLUME ["/app/data"]
ENTRYPOINT ["/entrypoint.sh"]
+1 -1
View File
@@ -4,7 +4,7 @@ services:
image: cyi-box:latest
container_name: cyibox
ports:
- "8890:80" # 对外端口,左侧可改成任意宿主端口
- "8890:8890" # 对外端口:容器内 nginx 同时监听 80 与 8890,左侧随意改
volumes:
- cyibox-data:/app/data # SQLite + vault.key + 网盘文件都落这里
environment:
+1 -1
View File
@@ -4,7 +4,7 @@ services:
image: cyi-box:latest
container_name: cyibox
ports:
- "8890:80" # 对外端口,左侧可改成任意宿主端口
- "8890:8890" # 对外端口:容器内 nginx 同时监听 80 与 8890,左侧随意改
volumes:
- cyibox-data:/app/data # SQLite + vault.key + 网盘文件都落这里
environment:
+6 -5
View File
@@ -1,5 +1,6 @@
server {
listen 80;
listen 8890;
server_name _;
root /app/web/dist;
index index.html;
@@ -9,7 +10,7 @@ server {
# 前端 RPC 约定走 /api 前缀,反代时剥掉(与 vite dev proxy 行为一致)
# /cell 同时承载 fun.Stream 的 NDJSON 长连接,必须关缓冲
location /api/ {
proxy_pass http://127.0.0.1:8890/;
proxy_pass http://127.0.0.1:8891/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@@ -31,7 +32,7 @@ server {
# /dbm/* 数据库导入导出
# *.php Epay 兼容支付端点
location ~ ^/(cell|mcp|healthz|m)$ {
proxy_pass http://127.0.0.1:8890;
proxy_pass http://127.0.0.1:8891;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@@ -41,7 +42,7 @@ server {
}
location ~ ^/(m|d|v1|files|disk|dbm)/ {
proxy_pass http://127.0.0.1:8890;
proxy_pass http://127.0.0.1:8891;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@@ -50,7 +51,7 @@ server {
}
location ~ ^/ws/ {
proxy_pass http://127.0.0.1:8890;
proxy_pass http://127.0.0.1:8891;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@@ -62,7 +63,7 @@ server {
}
location ~ ^/(submit|mapi|api)\.php$ {
proxy_pass http://127.0.0.1:8890;
proxy_pass http://127.0.0.1:8891;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;