Skip to content

Commit

Permalink
Merge pull request #397 from sparcs-kaist/#396-bug-set-trust-proxy
Browse files Browse the repository at this point in the history
[Bug] trust proxy 설정
  • Loading branch information
14KGun authored Sep 24, 2023
2 parents 5017281 + 9e0fce4 commit cffb806
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ connectDatabase();
app.use(express.urlencoded({ extended: false }));
app.use(express.json());

// reverse proxy가 설정한 헤더를 신뢰합니다.
app.set("trust proxy", true);

// [Middleware] CORS 설정
app.use(require("./src/middlewares/cors"));

Expand Down
2 changes: 1 addition & 1 deletion src/middlewares/limitRate.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const rateLimit = require("express-rate-limit");

const limiter = rateLimit({
windowMs: 15 * 60 * 1000, // 15 minutes
max: 1500, // Limit each IP to 100 requests per `window` (here, per 15 minutes)
max: 1500, // Limit each IP to 1500 requests per `window` (here, per 15 minutes)
standardHeaders: true, // Return rate limit info in the `RateLimit-*` headers
legacyHeaders: false, // Disable the `X-RateLimit-*` headers
});
Expand Down

0 comments on commit cffb806

Please sign in to comment.