• The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question Enable CORS for dockerized node.js api

Balduraan

New Pleskian
Hello there!

I have an ubuntu server with plesk obsidian 18.x running.
I have an dockerized node.js graphql api up and running. The api request are comming from an angular pwa and
I get an error that access was blocked due to cors policy.

I enabled CORS inside node.js of course, but I have no clue how to allow / configure CORS in plesk for a docker container.
Plesk is proxying requests from api.domain.com to the said container.

I hope someone can help me solving this problem. This is killing my development progress.

Edit: In plesk under "Settings for Apache & Nginx for api.domain.com" I added additional nginx-instructions: add_header 'Access-Control-Allow-Origin' '*';
And the error message changes to:
Code:
Access to fetch at 'https://api.domain.com/graphql' from origin 'https://app.domain.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed. Have the server send the header with a valid value, or, if an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
 
Last edited:
Back
Top