File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ import { rateLimitRequests } from './middlewares/rateLimit.middleware';
1616
1717export const createServer = ( ) : Express => {
1818 const app = express ( ) ;
19+
20+ // Trust proxy (CRITICAL for Nginx reverse proxy)
21+ app . set ( 'trust proxy' , 1 ) ;
22+
1923 app
2024 . disable ( 'x-powered-by' )
2125 . use ( morgan ( 'dev' ) )
@@ -33,9 +37,12 @@ export const createServer = (): Express => {
3337 cookie : {
3438 secure : process . env . NODE_ENV === 'production' ,
3539 httpOnly : true ,
36- maxAge : 2 * 24 * 60 * 60 * 1000 ,
40+ maxAge : 2 * 24 * 60 * 60 * 1000 , // 2 days
3741 sameSite : process . env . NODE_ENV === 'production' ? 'none' : 'lax' ,
38- domain : process . env . NODE_ENV === 'production' ? process . env . COOKIE_DOMAIN : undefined ,
42+ domain :
43+ process . env . NODE_ENV === 'production'
44+ ? process . env . COOKIE_DOMAIN
45+ : undefined ,
3946 } ,
4047 resave : false ,
4148 saveUninitialized : false ,
You can’t perform that action at this time.
0 commit comments