Skip to content

Commit 3465393

Browse files
authored
Merge pull request #328 from Nathanael-Mtd/master
feat : add reverse proxy support
2 parents 49e16a9 + 70295ba commit 3465393

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

config.js

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ const config = {
2222
// can be true or a specific url like https://example.com:8443
2323
// keep empty to disable
2424
"forceHttps": '',
25+
// Use trust proxy to show real IP on logs when reverse proxy are used
26+
// see https://expressjs.com/en/guide/behind-proxies.html for options
27+
"trustProxy": '',
2528
// retention options in seconds:label
2629
"retentions": {
2730
"one-time": "one time download",

lib/endpoints.js

+4
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ if (config.accessLog) {
4242
app.use(morgan(config.accessLog));
4343
}
4444

45+
if (config.trustProxy) {
46+
app.set('trust proxy', config.trustProxy);
47+
}
48+
4549
if (config.forceHttps) {
4650
app.enable('trust proxy');
4751
app.use(function(req, res, next) {

0 commit comments

Comments
 (0)