forked from forgejo/forgejo
Allow Gogs to run from a suburl behind a reverse proxy. e.g. http://mydomain.com/gogs/
Conflicts: modules/setting/setting.go Conflicts: templates/repo/release/list.tmpl templates/user/dashboard/dashboard.tmpl Conflicts: routers/repo/setting.go
This commit is contained in:
parent
4f74b4e657
commit
0055cbd365
91 changed files with 322 additions and 300 deletions
|
@ -13,6 +13,7 @@ import (
|
|||
"github.com/gogits/gogs/modules/base"
|
||||
"github.com/gogits/gogs/modules/log"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -126,7 +127,7 @@ func Profile(ctx *middleware.Context) {
|
|||
uname := ctx.Params(":username")
|
||||
// Special handle for FireFox requests favicon.ico.
|
||||
if uname == "favicon.ico" {
|
||||
ctx.Redirect("/img/favicon.png")
|
||||
ctx.Redirect(setting.AppRootSubUrl + "/img/favicon.png")
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -141,7 +142,7 @@ func Profile(ctx *middleware.Context) {
|
|||
}
|
||||
|
||||
if u.IsOrganization() {
|
||||
ctx.Redirect("/org/" + u.Name)
|
||||
ctx.Redirect(setting.AppRootSubUrl + "/org/" + u.Name)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -181,7 +182,7 @@ func Email2User(ctx *middleware.Context) {
|
|||
}
|
||||
return
|
||||
}
|
||||
ctx.Redirect("/user/" + u.Name)
|
||||
ctx.Redirect(setting.AppRootSubUrl + "/user/" + u.Name)
|
||||
}
|
||||
|
||||
const (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue