CORS error on HADashboard

Hi,

I’ve installed HADashboard on Hass.io using vkorn’s appdaemon add-on and got it running. I’ve also installed nginx proxy and edited my hosts file to match cp.local.io to my Rasperry local ip addres.

This is my appdaemon.yaml:

 AppDaemon:
  cert_verify: False
  disable_apps: 1
  logfile: STDOUT
  errorfile: STDERR
  threads: 10
  app_dir: /config/hadaemon/apps
HASS:
  ha_url: http://192.168.1.229:8123
HADashboard:
  dash_url: http://cp.local.io
  dash_dir: /config/hadaemon/dashboards

These are my addon configurations:

AppDaemon:

{
   "domain": "cp.local.io"
}

Nginx proxy:

{
  "vhosts": [
    {
      "default_server": false,
      "port": "3030",
      "vhost": "cp.local.io"
    }
  ]
}

Unfortunately, when I go to cp.local.io in browser I get an error saying

Error getting state, check Java Console for details

and in the browser console I can see

XMLHttpRequest cannot load http://192.168.1.229/state/light.korytarz. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://cp.local.io’ is therefore not allowed access.

I’ve tried running chrome with web-security disabled, using this run command:

chrome.exe --user-data-dir=“C:/Chrome dev session” --disable-web-security

and then error dissapears. Unfortunately, this doesn’t solve my problem, because I want ultimately to run HADashboard on Android tablet and I can’t find a way to disable web security on Android.
Any help please?

I’ve manage to solve my problem, this is configuration that works for me:
Nginx proxy:

{
  "vhosts": [
    {
      "default_server": true,
      "port": "3030",
      "vhost": "192.168.1.229"
    }
  ]
}

AppDaemon:

{
  "domain": "192.168.1.229"
}

appdaemon.yaml:

AppDaemon:
  cert_verify: False
  disable_apps: 1
  logfile: STDOUT
  errorfile: STDERR
  threads: 10
  app_dir: /config/hadaemon/apps
HASS:
  ha_url: http://192.168.1.229:8123
HADashboard:
  dash_url: http://192.168.1.229
  dash_dir: /config/hadaemon/dashboards

Home Assistant is available at 192.168.1.229:8123 and HADashboard at 192.168.1.229.