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
The ending slash shouldn't be used, because it causes nginx to unescape the path encodings, it breaks %2f in the path, breaks some Gitea git refs/paths and some Gitea package names/paths.
Note that the "Buggy" section has a slash so that it will work for the sub-path.
If you remove the slash, all pages on Gitea will get a 404, because the "git/" sub-path is being passed to all URLs to Gitea.
To fix that, this hack is needed:
location /git/ {
# this hack prevents URL encoding, which can break the Packages area, for package names with slashes
rewrite ^ $request_uri;
rewrite ^/git(/.*) $1 break;
return 400; # if the second rewrite won't match
proxy_pass http://127.0.0.1:1234$uri;
Close#23711, thanks to @ghnp5 !
Close#24612, thanks to @DanielGibson !
Major changes:
* the default value of nginx's client_max_body_size is too small, so put
a 512M here
* move `Resolving Error: 413 Request Entity Too Large` to a sub-section
of `Nginx` section
* make nginx use unescaped the URI and keep "%2F" as is when using
sub-path
* add details for General sub-path configuration
Description
Correct: https://docs.gitea.io/en-us/reverse-proxies/#nginx
Buggy: https://docs.gitea.io/en-us/reverse-proxies/#nginx-with-a-sub-path
The ending slash shouldn't be used, because it causes nginx to unescape the path encodings, it breaks
%2f
in the path, breaks some Gitea git refs/paths and some Gitea package names/paths.More details:
Thanks to @ghnp5
The text was updated successfully, but these errors were encountered: