Skip to content

Commit

Permalink
trust all proxies
Browse files Browse the repository at this point in the history
  • Loading branch information
gianfra-t committed Jan 20, 2025
1 parent 4d91fdf commit 9e9e45d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion signer-service/src/config/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,21 @@ app.use(

// enable rate limiting
// Set number of expected proxies
app.set('trust proxy', rateLimitNumberOfProxies);
app.set('trust proxy', true);

// Add this before your rate limiter
app.use((req, res, next) => {
console.log({
'Raw Socket IP': req.socket.remoteAddress,
'Express req.ip': req.ip,
'X-Forwarded-For': req.headers['x-forwarded-for'],
'X-Real-IP': req.headers['x-real-ip'],
'All Headers': req.headers,
'Trust Proxy Setting': app.get('trust proxy'),
});
next();
});

// Define rate limiter
const limiter = rateLimit({
windowMs: rateLimitWindowMinutes * 60 * 1000,
Expand Down

0 comments on commit 9e9e45d

Please sign in to comment.