You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/content/doc/administration/reverse-proxies.en-us.md
+28-17
Original file line number
Diff line number
Diff line change
@@ -25,12 +25,13 @@ menu:
25
25
26
26
If you want Nginx to serve your Gitea instance, add the following `server` section to the `http` section of `nginx.conf`:
27
27
28
-
```apacheconf
28
+
```
29
29
server {
30
30
listen 80;
31
31
server_name git.example.com;
32
32
33
33
location / {
34
+
client_max_body_size 512M;
34
35
proxy_pass http://localhost:3000;
35
36
proxy_set_header Host $host;
36
37
proxy_set_header X-Real-IP $remote_addr;
@@ -40,23 +41,31 @@ server {
40
41
}
41
42
```
42
43
44
+
### Resolving Error: 413 Request Entity Too Large
45
+
46
+
This error indicates nginx is configured to restrict the file upload size,
47
+
you can fine tune the `client_max_body_size` option according to [nginx document](http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size).
48
+
43
49
## Nginx with a sub-path
44
50
45
51
In case you already have a site, and you want Gitea to share the domain name, you can setup Nginx to serve Gitea under a sub-path by adding the following `server` section inside the `http` section of `nginx.conf`:
# make nginx use unescaped the URI, keep "%2F" as is
63
+
rewrite ^ $request_uri;
64
+
rewrite ^/gitea(/.*) $1 break;
65
+
proxy_pass http://127.0.0.1:3000$uri;
66
+
67
+
# other common HTTP headers, see the "Nginx" config section above
68
+
proxy_set_header ...
60
69
}
61
70
}
62
71
```
@@ -132,14 +141,6 @@ server {
132
141
}
133
142
```
134
143
135
-
## Resolving Error: 413 Request Entity Too Large
136
-
137
-
This error indicates nginx is configured to restrict the file upload size.
138
-
139
-
In your nginx config file containing your Gitea proxy directive, find the `location { ... }` block for Gitea and add the line
140
-
`client_max_body_size 16M;` to set this limit to 16 megabytes or any other number of choice.
141
-
If you use Git LFS, this will also limit the size of the largest file you will be able to push.
142
-
143
144
## Apache HTTPD
144
145
145
146
If you want Apache HTTPD to serve your Gitea instance, you can add the following to your Apache HTTPD configuration (usually located at `/etc/apache2/httpd.conf` in Ubuntu):
@@ -387,3 +388,13 @@ gitea:
387
388
This config assumes that you are handling HTTPS on the traefik side and using HTTP between Gitea and traefik.
388
389
389
390
Then you **MUST** set something like `[server] ROOT_URL = http://example.com/gitea/` correctly in your configuration.
391
+
392
+
## General sub-path configuration
393
+
394
+
Usually it's not recommended to put Gitea in a sub-path, it's not widely used and may have some issues in rare cases.
395
+
396
+
If you really need to do so, to make Gitea works with sub-path (eg: `http://example.com/gitea/`), here are the requirements:
397
+
398
+
1. Set `[server] ROOT_URL = http://example.com/gitea/` in your `app.ini` file.
399
+
2. Make the reverse-proxy pass `http://example.com/gitea/foo` to `http://gitea-server:3000/foo`.
400
+
3. Make sure the reverse-proxy do not escape the URI, the request `http://example.com/gitea/a%2Fb` should be passed as `http://gitea-server:3000/a%2Fb`.
0 commit comments