diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2021-10-16 11:34:07 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-15 23:34:07 -0400 |
commit | e18ea9e3491e872d0a0736322ace4def5680432c (patch) | |
tree | 31fe00ae5331ffc5b0553795efda9a03b5ab5916 /docs/content/doc/usage/reverse-proxies.en-us.md | |
parent | 55885297f471603de6212917a47ceb2078a449d1 (diff) | |
download | gitea-e18ea9e3491e872d0a0736322ace4def5680432c.tar.gz gitea-e18ea9e3491e872d0a0736322ace4def5680432c.zip |
Update documents for Gitea behind reverse proxy. Fix some small bugs (some URLs are generated without sub-path) (#17320)
* Apache `ProxyPassReverse` only works for Location, Content-Location and URI headers on HTTP redirect responses, it causes more problems than it resolves. Now all URLs generated by Gitee have the correct prefix AppSubURL. We do not need to set `ProxyPassReverse`.
* fix url param
* use AppSubURL instead of AppURL in api/v1
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'docs/content/doc/usage/reverse-proxies.en-us.md')
-rw-r--r-- | docs/content/doc/usage/reverse-proxies.en-us.md | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/docs/content/doc/usage/reverse-proxies.en-us.md b/docs/content/doc/usage/reverse-proxies.en-us.md index 5f1e6685ec..9a2552b711 100644 --- a/docs/content/doc/usage/reverse-proxies.en-us.md +++ b/docs/content/doc/usage/reverse-proxies.en-us.md @@ -43,13 +43,15 @@ server { listen 80; server_name git.example.com; - location /git/ { # Note: Trailing slash - proxy_pass http://localhost:3000/; # Note: Trailing slash + # Note: Trailing slash + location /git/ { + # Note: Trailing slash + proxy_pass http://localhost:3000/; } } ``` -Then set `[server] ROOT_URL = http://git.example.com/git/` in your configuration. +Then you **MUST** set something like `[server] ROOT_URL = http://git.example.com/git/` correctly in your configuration. ## Nginx and serve static resources directly @@ -139,11 +141,10 @@ If you want Apache HTTPD to serve your Gitea instance, you can add the following ProxyRequests off AllowEncodedSlashes NoDecode ProxyPass / http://localhost:3000/ nocanon - ProxyPassReverse / http://localhost:3000/ </VirtualHost> ``` -Note: The following Apache HTTPD mods must be enabled: `proxy`, `proxy_http` +Note: The following Apache HTTPD mods must be enabled: `proxy`, `proxy_http`. If you wish to use Let's Encrypt with webroot validation, add the line `ProxyPass /.well-known !` before `ProxyPass` to disable proxying these requests to Gitea. @@ -161,13 +162,12 @@ In case you already have a site, and you want Gitea to share the domain name, yo AllowEncodedSlashes NoDecode # Note: no trailing slash after either /git or port ProxyPass /git http://localhost:3000 nocanon - ProxyPassReverse /git http://localhost:3000 </VirtualHost> ``` -Then set `[server] ROOT_URL = http://git.example.com/git/` in your configuration. +Then you **MUST** set something like `[server] ROOT_URL = http://git.example.com/git/` correctly in your configuration. -Note: The following Apache HTTPD mods must be enabled: `proxy`, `proxy_http` +Note: The following Apache HTTPD mods must be enabled: `proxy`, `proxy_http`. ## Caddy |