How to change Access-Control-Allow-Origin headers for WeKan?

My YunoHost server

Hardware: VPS bought online
YunoHost version: 4.4.2.1
I have access to my server : Through SSH and through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Description of my issue

What you are trying to achieve: I want to get my WeKan installation to work with Titra.

In which context: my WeKan installation is at a subdomain, and it’s the only app installed on that subdomain. In order to integrate it with Titra, the wiki at Wekan says that I need to get my server to allow the requests from Titra by setting the “Access-Control-Allow-Origin header to allow access from the titra environment”. The link they offer on how to do that is to the docker-compose.yml file of WeKan.

What you tried: I searched for the configuration file that might be able to help me achieve this, and I have a feeling it is /etc/yunohost/apps/wekan/conf/nginx.conf? Or could it be somewhere in the nginx core config files, like here?

Since I’m not familiar with nginx, nor clear which file needs to be changed, I thought I’d ask first.

Thank you!

Hi,

It should be in file /etc/nginx/conf.d/<subdomain_of_wekan>.d/wekan.conf.

You should add something like

    more_set_headers "Access-Control-Allow-Origin: https://example.com"; # Replace with the right domain of Titra that will use your wekan
    more_set_headers "Access-Control-Allow-Methods: GET, POST, PUT"; # List of methods to authorize
    more_set_headers "Access-Control-Allow-Headers: Authorization, HeaderName, AnotherHeaderName"; # List of headers to authorize.
    more_set_headers "Access-Control-Allow-Credentials: true"; # If needed

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.