Creling / obsidian-image-uploader

MIT License
36 stars 6 forks source link

Uploading an image to a remote server prompts a “CORS” error #5

Closed getopenwrt closed 1 year ago

getopenwrt commented 2 years ago

Hi, I have encountered an error when using image uploader,The error message viewed through the developer tools is related to CORS. obsidian version:0.15.9 image uploader :0.2 Uploading images using IP addresses is successful Snipaste_2022-09-10_02-59-29 Uploading images using a domain name prompts an error Snipaste_2022-09-10_03-00-16 Snipaste_2022-09-10_03-02-42 Snipaste_2022-09-10_03-14-09

Creling commented 2 years ago

Hello, this error is caused by a mis-configure on your backend server, please refer https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS for more information.

To solve this problem, you could add Access-Control-Allow-Origin header in your NGINX/Apache config file.

https://serverfault.com/questions/162429/how-do-i-add-access-control-allow-origin-in-nginx