'Origin not allowed' error on Grafana dashboard when accessing through AWS REST API

Hi Team,

I am trying to access the grafana UI from the AWS REST API. The configuration is as follows: AWS REST API (with CORS enabled) → internal NLB → ECS hosting Grafana server. The rest api is running on the url : url_of_https_api/dev where ‘dev’ is the stage name which is mandatory in REST API.

My grafana config looks like this:

[server]
enable_gzip = true
protocol = http
domain = api-id.execute-api.region.amazonaws.com
enforce_domain = false
root_url = https://api-id.execute-api.region.amazonaws.com/dev

[security
allow_embedding = true
cookie_samesite = none
cookie_secure = true

Could you please help me why I am getting ‘Origin not allowed’ error?

Your infra must forward host header. So I guess

@jangaraj, thanks for responding. I am passing the host header from the REST API, but still it does not seem to work. I observed that the requests that start with /api like /api/ds/query?ds_type=loki&requestId=Q100_1 are failing, do we need to take care of anything else?

I don’t know. Contact your AWS support. If you are using REST API in front of ECS service, then you must know what you are doing. Standard admin will use ALB, because Grafana is service, not just API.