vh13294 / nestjs-url-generator

Dynamically generating & signing URL based on controller method reference.
MIT License
44 stars 17 forks source link

403 Forbidden resource - Nest.js with reverse proxy #15

Open ktmohammedsulaim opened 1 year ago

ktmohammedsulaim commented 1 year ago

Hi, I've implemented signed URL feature for unsubscribing email notifications and it works fine in the local environment. But, when the code was deployed to the server it always throws 403 Forbidden resource error. We are using https reverse proxy with Apache web server along with pm2. But even after adding app.set('trust proxy', true); to the main.ts file. It's still throwing the error.

supakornkim commented 1 year ago

hi, I also facing this issue. please let me know if you can solved this.

ktmohammedsulaim commented 1 year ago

@supakornkim Not yet. I couldn't find a solution for this issue

vh13294 commented 1 year ago

I think it's something to do with CORS, can you try something like this.

app.use(cors({ origin : '*'}));

Or just allow CORS for one particular route!