I have a v9 Nestjs
, graphql
that works locally without any issues but when deployed on a digital ocean droplet with nginx, accessing playground
says Server cannot be reached
. And as such the Schema and Doc tabs on the playground don't load. However, a query or mutation request works. How can I solve this?
I applied cors as shown below but it made no difference
const app = await NestFactory.create(AppModule, {
cors: {
credentials: true,
origin: ['http://localhost:3000', 'https://api.my-live-server.io'],
},
});
The related dependencies are:
"@nestjs/apollo": "10.1.0",
"@nestjs/graphql": "10.1.2",
Worth-noting that an issue almost similar as asked here on Stackoverflow and the answer pointed to a Github issue that doesn't have exactly the same circumstance and doesn't resolve this.