From 5faac2e1becfd45b0bdbd0c60e84a8676fe4568e Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sat, 7 Oct 2023 13:14:37 +0000 Subject: [PATCH 1/2] Add section for reverse proxies. --- docs/content/usage/packages/container.en-us.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/content/usage/packages/container.en-us.md b/docs/content/usage/packages/container.en-us.md index 6be21c2b276f4..7a71bffc8a4e0 100644 --- a/docs/content/usage/packages/container.en-us.md +++ b/docs/content/usage/packages/container.en-us.md @@ -23,6 +23,23 @@ The container registry follows the OCI specs and supports all compatible images To work with the Container registry, you can use the tools for your specific image type. The following examples use the `docker` client. +### Reverse Proxy / URL Prefix + +The container registry uses a fixed url path `/v2` which can't be changed. +Even if you deploy Gitea with a prefix, `/v2` will be used by the `docker` client. +Therefore you may need to add an additional route to your reverse proxy configuration. + +Example using nginx: +``` +location /gitea/ { ## normal Gitea route + proxy_pass http://gitea:3000/; +} + +location /v2/ { ## Gitea Docker Registry route + proxy_pass http://gitea:3000/v2/; +} +``` + ## Login to the container registry To push an image or if the image is in a private registry, you have to authenticate: From a12b938be9880e8a137195c583ba3d34051e543e Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sun, 8 Oct 2023 09:11:19 +0000 Subject: [PATCH 2/2] Moved docs. --- .../administration/reverse-proxies.en-us.md | 6 ++++++ docs/content/usage/packages/container.en-us.md | 17 ----------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/docs/content/administration/reverse-proxies.en-us.md b/docs/content/administration/reverse-proxies.en-us.md index c141483700511..fe54c67d02795 100644 --- a/docs/content/administration/reverse-proxies.en-us.md +++ b/docs/content/administration/reverse-proxies.en-us.md @@ -381,3 +381,9 @@ If you really need to do so, to make Gitea works with sub-path (eg: `http://exam 1. Set `[server] ROOT_URL = http://example.com/gitea/` in your `app.ini` file. 2. Make the reverse-proxy pass `http://example.com/gitea/foo` to `http://gitea-server:3000/foo`. 3. Make sure the reverse-proxy not decode the URI, the request `http://example.com/gitea/a%2Fb` should be passed as `http://gitea-server:3000/a%2Fb`. + +## Docker / Container Registry + +The container registry uses a fixed sub-path `/v2` which can't be changed. +Even if you deploy Gitea with a different sub-path, `/v2` will be used by the `docker` client. +Therefore you may need to add an additional route to your reverse proxy configuration. diff --git a/docs/content/usage/packages/container.en-us.md b/docs/content/usage/packages/container.en-us.md index 7a71bffc8a4e0..6be21c2b276f4 100644 --- a/docs/content/usage/packages/container.en-us.md +++ b/docs/content/usage/packages/container.en-us.md @@ -23,23 +23,6 @@ The container registry follows the OCI specs and supports all compatible images To work with the Container registry, you can use the tools for your specific image type. The following examples use the `docker` client. -### Reverse Proxy / URL Prefix - -The container registry uses a fixed url path `/v2` which can't be changed. -Even if you deploy Gitea with a prefix, `/v2` will be used by the `docker` client. -Therefore you may need to add an additional route to your reverse proxy configuration. - -Example using nginx: -``` -location /gitea/ { ## normal Gitea route - proxy_pass http://gitea:3000/; -} - -location /v2/ { ## Gitea Docker Registry route - proxy_pass http://gitea:3000/v2/; -} -``` - ## Login to the container registry To push an image or if the image is in a private registry, you have to authenticate: