[x]):I'm sorry, please forgive me, my English is not very good
I run gitea in docker and use Nginx to reverse proxy
I only applied for an SSL certificate for my domain name: home.example.com, and I can't access home through ports 80 and 443
I want to access gitea via https://home.example.com:9881/git/
The documentation in https://docs.gitea.io/en-us/reverse-proxies/#using-nginx-with-a-sub-path-as-a-reverse-proxy doesn't work, it returns 404
The method provided in #6943 https://github.com/linuxserver/reverse-proxy-confs/blob/master/gitea.subfolder.conf.sample is able to display the homepage normally, but when I login successfully, the page jumps to https://home.example.com/git/
Here are my configuration files:
location /git {
return 301 $scheme://$host/git/;
}
location ^~ /git/ {
resolver 172.17.0.2 valid=30s;
set $upstream_app 172.17.0.2;
set $upstream_port 3000;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
rewrite /git(.*) $1 break;
}
[server]
APP_DATA_PATH = /data/gitea
SSH_DOMAIN = home.example.com:9888
HTTP_PORT = 3000
ROOT_URL = https://home.example.com:9881/git/
DISABLE_SSH = false
SSH_PORT = 9888
SSH_LISTEN_PORT = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = /disk2/data/git/lfs
DOMAIN = home.example.come:9881
OFFLINE_MODE = false
In addition, I found that I can't access http://home.example.com:9889/git/ normally even without using a reverse proxy.
APP_DATA_PATH = /data/gitea
SSH_DOMAIN = home.example.com:9888
HTTP_PORT = 3000
ROOT_URL = https://home.example.com:9889/git/
DISABLE_SSH = false
SSH_PORT = 9888
SSH_LISTEN_PORT = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = /disk2/data/git/lfs
DOMAIN = home.example.come:9889
OFFLINE_MODE = false
The sub-path has caused me a lot of trouble. I don't think this is a mature function that can be written into the Features


I added the port in the Nginx configuration, and now I can login normally
But I still hope that gitea can be configured as simple as the documentation to achieve the same effect
location /git {
return 301 $scheme://$host:$server_port/git/;
}
location ^~ /git/ {
resolver 172.17.0.2 valid=30s;
set $upstream_app 172.17.0.2;
set $upstream_port 3000;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
rewrite /git(.*) $1 break;
}
Please feel free to submit PR to improve documentation
Closing as resolved configuration issue
Most helpful comment
I added the port in the Nginx configuration, and now I can login normally
But I still hope that gitea can be configured as simple as the documentation to achieve the same effect