I need assistance, i am unsure how to make the API response from "api.glossgenius.com" work properly to get elements of the site working.
https://studio21md.com/portfolio
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.glossgenius.com/v3/web/portfolio_images?slug=meganhammett. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.glossgenius.com/v3/web/portfolio_images?slug=meganhammett. (Reason: CORS request did not succeed).
Can anyone assist on Nginx how i would solve this specific issue?
Here is my config, Thank you for your assistance.
server {
listen 80;
server_name www.studio21md.com studio21md.com;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
proxy_pass https://meganhammett.glossgenius.com;
}
2
Answers
Please use this config in nginx.
As I understand you do not have access to the backend of api.glossgenius and you are calling it from the javascript.
I would try calling that glossgenius api from your backend. And make endpoint so that your frontend calls your backend. You do not have cors problems from your frontend calling your backend as I understand.