mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 19:04:54 +00:00
trust reverse proxy
This commit is contained in:
@ -8,6 +8,12 @@ import { ValidationPipe } from '@nestjs/common';
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AuthModule);
|
||||
|
||||
// Enable 'trust proxy' setting
|
||||
app.use((req, res, next) => {
|
||||
app.getHttpAdapter().getInstance().set('trust proxy', 1);
|
||||
next();
|
||||
});
|
||||
|
||||
app.enableCors();
|
||||
|
||||
app.use(
|
||||
|
||||
@ -6,6 +6,14 @@ import { ValidationPipe } from '@nestjs/common';
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(BackendModule);
|
||||
|
||||
// Enable 'trust proxy' setting
|
||||
app.use((req, res, next) => {
|
||||
app.getHttpAdapter().getInstance().set('trust proxy', 1);
|
||||
next();
|
||||
});
|
||||
|
||||
|
||||
app.enableCors();
|
||||
|
||||
app.use(
|
||||
|
||||
Reference in New Issue
Block a user