#75 add ExtOrigin config to handle lfs-test-server behind a reverse proxy case #110
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As described in #75, when the
lfs-test-server
is behind a reverse proxy, theLFS_HOST
will not denote the external link correctly. For example, the external link ishttps://git-lfs.example.com
served bynginx
, theLFS_LISTEN
istcp://localhost:1234
andLFS_SCHEME
ishttp
. WhateverLFS_HOST
is set, the external URL is incorrect.I added additional config, i.e.,
LFS_EXTORIGIN
, which is blank by default. If it is blank, the old method will be used to denote the external origin, as follows:However, when the user set
LFS_EXTORIGIN
, it will be used to skip the old setting, e.g.,LFS_EXTORIGIN='https://git-lfs.example.com'
.By the way, why not use
Config.ExtOrigin = fmt.Sprintf("%s://%s", Config.Scheme, Config.Host)
to replace the above old external link generation method?