Skip to content

Commit

Permalink
feat(Docker): expose a SKIP_X_FORWARD_HEADERS option (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
a65162 authored Dec 15, 2024
1 parent a2319fd commit b3677ab
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ QBIT_BASE=http://host.docker.internal:8080
RELEASE_TYPE=stable
UPDATE_VT_CRON=0 * * * *
USE_INSECURE_SSL=false
SKIP_X_FORWARD_HEADERS=false
VUETORRENT_PATH=/vuetorrent
2 changes: 2 additions & 0 deletions docker-compose.gluetun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,7 @@ services:
- UPDATE_VT_CRON=0 * * * *
# Only enable if using self-signed certificates
# - USE_INSECURE_SSL=true
# Only enable if backend container is behind a proxy server which already add x-forward headers
# - SKIP_X_FORWARD_HEADERS=true
volumes:
- "./data/config:/config"
2 changes: 2 additions & 0 deletions docker-compose.simple.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ services:
- UPDATE_VT_CRON=0 * * * *
# Only enable if using self-signed certificates
# - USE_INSECURE_SSL=true
# Only enable if backend container is behind a proxy server which already add x-forward headers
# - SKIP_X_FORWARD_HEADERS=true
ports:
- "8080:8080"
volumes:
Expand Down
2 changes: 1 addition & 1 deletion src/routers/qbit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const router = Router()
router.use((req, res, next) => {
const proxy = httpProxy.createProxyServer({
host: process.env.QBIT_BASE,
xfwd: true,
xfwd: process.env.SKIP_X_FORWARD_HEADERS !== 'true',
secure: process.env.USE_INSECURE_SSL !== 'true',
})
proxy.web(req, res, { target: `${process.env.QBIT_BASE}/api` }, next)
Expand Down

0 comments on commit b3677ab

Please sign in to comment.