Skip to content

Commit 4135162

Browse files
authored
Merge pull request #106 from ixofoundation/develop
fix: add trust proxy to express for rate limiter
2 parents b6c9522 + edae5cd commit 4135162

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

.env-example renamed to .env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
PORT=5000
2+
# express trust proxy config for if you are using a reverse proxy
3+
TRUST_PROXY=1
24
MEMCACHE_URI=127.0.0.1:11211
35
BLOCKSYNC_URI_REST=http://localhost:8080/api/
46
CONFIG=./config.json

src/App.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class App {
3737
private middleware(): void {
3838
const schema = buildSchemaSync({ resolvers });
3939

40+
this.express.set('trust proxy', process.env.TRUST_PROXY || 1);
4041
this.express.use(cors());
4142
this.express.use(compression({ threshold: 0 }));
4243
this.express.use(bodyParser.urlencoded({ limit: '50mb', extended: true }));

0 commit comments

Comments
 (0)