Hi there,
I would like to use the API in mailcow to create a mailbox. If I send off a request I am keep getting the following error:
“Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.”
I know this is a cross domain issue, therefor I have adapted the settings in
/opt/mailcow-dockerized/data/conf/nginx/site.conf
server {
root /web;
listen 80 default_server;
listen [::]:80 default_server;
include /etc/nginx/conf.d/server_name.active;
if ( $request_uri ~* “%0A|%0D” ) { return 403; }
location ^~ /.well-known/acme-challenge/ {
allow all;
default_type “text/plain”;
}
location /.well-known/host-meta {
default_type ‘application/json’;
add_header Access-Control-Allow-Origin ‘*’ always;
}
location / {
return 301 https://$host$uri$is_args$args;
}
}
server_tokens off;
proxy_cache_path /tmp levels=1:2 keys_zone=sogo:10m inactive=24h max_size=1g;
// file end
Anyway it doesn’t work!!! Can someone please tell me, how to allow posts from another server?
Regards
Kiwi