Skip to content

Self-hosted personal gallery application with online photo management and albums, supporting Live/Motion Photos, EXIF parsing, geolocation recognition, and an explore map.

docs: clarify proxy setup with localhost port binding

Timothy Yin6ed517ceb94f
diff --git a/docs/guide/getting-started.md b/docs/guide/getting-started.md
index 1ce3f25a..33e61b97 100644
--- a/docs/guide/getting-started.md
+++ b/docs/guide/getting-started.md
@@ -72,14 +72,22 @@ Keep the data directory when replacing a container. Files stored in S3 or OpenLi
You can place Caddy, Nginx or Traefik in front of the container. Match the proxy upload limit to your dashboard setting and allow streaming responses for live logs.
::: warning Trust only your own proxy
-Enable `NUXT_TRUST_PROXY=true` only if port 3000 is reachable exclusively through a trusted proxy that replaces client-supplied `X-Forwarded-For` headers. This deployment option still uses an environment variable, for example in Compose:
+Enable `NUXT_TRUST_PROXY=true` only if port 3000 is reachable exclusively through a trusted proxy that replaces client-supplied `X-Forwarded-For` headers. This deployment option still uses an environment variable.
:::
+For a proxy running on the host, replace the existing `chronoframe` service's `ports` and `environment` fields with the following. Replace `3000:3000`; do not retain a publicly bound port mapping:
+
```yaml
-environment:
- NUXT_TRUST_PROXY: 'true'
+services:
+ chronoframe:
+ ports:
+ - '127.0.0.1:3000:3000'
+ environment:
+ NUXT_TRUST_PROXY: 'true'
```
+Keep the existing image, volumes and other service configuration. If the proxy also runs in a container, put both services on a private Docker network, proxy to `http://chronoframe:3000`, and remove the application service's `ports` mapping.
+
An Nginx application proxy block can look like this:
```nginx
diff --git a/docs/zh/guide/getting-started.md b/docs/zh/guide/getting-started.md
index 92362583..966106d7 100644
--- a/docs/zh/guide/getting-started.md
+++ b/docs/zh/guide/getting-started.md
@@ -72,14 +72,22 @@ docker run -d --name chronoframe --restart unless-stopped \
可以在容器前使用 Caddy、Nginx 或 Traefik。反向代理的上传大小上限应与后台设置匹配,并保留流式响应,供实时日志使用。
::: warning 仅信任受控代理
-只有在 3000 端口只能被可信代理访问、且代理会覆盖用户传入的 `X-Forwarded-For` 时,才启用 `NUXT_TRUST_PROXY=true`。这项部署设置仍使用环境变量,例如在 Compose 中加入:
+只有在 3000 端口只能被可信代理访问、且代理会覆盖用户传入的 `X-Forwarded-For` 时,才启用 `NUXT_TRUST_PROXY=true`。这项部署设置仍使用环境变量。
:::
+如果代理运行在宿主机上,将现有 `chronoframe` 服务的 `ports` 和 `environment` 改为下面的配置;替换原有的 `3000:3000`,不要保留对外开放的映射:
+
```yaml
-environment:
- NUXT_TRUST_PROXY: 'true'
+services:
+ chronoframe:
+ ports:
+ - '127.0.0.1:3000:3000'
+ environment:
+ NUXT_TRUST_PROXY: 'true'
```
+保留服务中原有的镜像、数据卷等其他配置。若代理也运行在容器中,让两个服务使用专用 Docker 网络,代理通过 `http://chronoframe:3000` 访问应用,并移除应用服务的 `ports` 映射。
+
Nginx 的应用代理段可参考:
```nginx