http: add "Use reverse proxy host" option
added "Use reverse-proxy reported "Host" when possible" option, which will prefer using the "Host" or "X-Forwarded-Host" values instead of "External jfa-go URL" in the web app. To do so, app.ExternalDomain/URI are now functions which take *gin.Context (the latter optionally). The protocol for the request is determined from X-Forwarded-Proto(col), so make sure your proxy includes it. The wiki will have been updated to mention the new option.
This commit is contained in:
@@ -88,7 +88,7 @@ func (app *appContext) BasePageTemplateValues(gc *gin.Context, page Page, base g
|
||||
|
||||
pages := PagePathsDTO{
|
||||
PagePaths: PAGES,
|
||||
ExternalURI: app.ExternalURI,
|
||||
ExternalURI: app.ExternalURI(gc),
|
||||
TrueBase: PAGES.Base,
|
||||
}
|
||||
pages.Base = app.getURLBase(gc)
|
||||
@@ -742,7 +742,7 @@ func (app *appContext) InviteProxy(gc *gin.Context) {
|
||||
discord := discordEnabled && app.config.Section("discord").Key("show_on_reg").MustBool(true)
|
||||
matrix := matrixEnabled && app.config.Section("matrix").Key("show_on_reg").MustBool(true)
|
||||
|
||||
userPageAddress := app.ExternalURI + PAGES.MyAccount
|
||||
userPageAddress := app.ExternalURI(gc) + PAGES.MyAccount
|
||||
|
||||
fromUser := ""
|
||||
if invite.ReferrerJellyfinID != "" {
|
||||
|
||||
Reference in New Issue
Block a user