Skip to content

Commit fffdcaa

Browse files
authored
Merge pull request #878 from jehartzog/proxy-count-config
Default HTTP_FORWARDED_COUNT to 1 for reverse proxy
2 parents 28d6d56 + ee56520 commit fffdcaa

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

docs/docs.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,11 @@ module.exports = {
186186

187187
// The port you access the app on. (optional, default is 80)
188188
// PORT: 8000
189+
190+
// The number of proxies in front of your server (optional, default is
191+
// 1 with reverse proxy, unused otherwise).
192+
// https://docs.meteor.com/api/connections.html
193+
// HTTP_FORWARDED_COUNT: 1
189194
},
190195

191196
// Docker log options (optional)

src/plugins/proxy/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export function prepareConfig(config) {
1818

1919
config.app.env.VIRTUAL_HOST = config.proxy.domains;
2020
config.app.env.HTTPS_METHOD = config.proxy.ssl && config.proxy.ssl.forceSSL ? 'redirect' : 'noredirect';
21+
config.app.env.HTTP_FORWARDED_COUNT =
22+
config.app.env.HTTP_FORWARDED_COUNT || 1;
2123

2224
if (config.proxy.ssl && config.proxy.ssl.letsEncryptEmail) {
2325
config.app.env.LETSENCRYPT_HOST = config.proxy.domains;

0 commit comments

Comments
 (0)