I deployed a Server on AWS EC2 instance. UI part is deployed on S3 bucket as a static website. After send a POST request from S3 to EC2 instance I get strict-origin-when-cross-origin error. The back-end app was created on Nest.js and CORS is already enabled.
Can somebody explain what I do wrong?
Sсhema
UI with error
Nest.js part
async function bootstrap() {
const appOptions = { bodyParser: false }
const app = await NestFactory.create(AppModule, appOptions)
app.enableCors()
app.useWebSocketAdapter(new RedisIoAdapter(app))
app.useGlobalPipes(new ValidationPipe({ transform: true }))
app.setGlobalPrefix('api')
app.use(bodyParser.json({ limit: '10mb', verify: rawBodyBuffer }))
app.use(bodyParser.urlencoded({ limit: '20mb', extended: true, verify: rawBodyBuffer }))
await app.listen(3000)
}
bootstrap()

