openeew / openeew-dashboard

Dashboards for monitoring devices, events, users, data and more. Built on Carbon and React.
http://dashboard.openeew.com
Apache License 2.0
25 stars 32 forks source link

rmv proxy due to Invalid Host header err #90

Closed EdrianI closed 3 years ago

krook commented 3 years ago

Does the backend API still work with this change?

I used a more complex approach for managing multiple API backends this way in the Prometeo dashboard. It allows for a CORS setting as an option to createProxyMiddleware:

https://github.com/Call-for-Code/Prometeo-Dashboard/blob/master/prometeo-dashboard/src/setupProxy.js

Would this approach help?

EdrianI commented 3 years ago

Does the backend API still work with this change?

I used a more complex approach for managing multiple API backends this way in the Prometeo dashboard. It allows for a CORS setting as an option to createProxyMiddleware:

https://github.com/Call-for-Code/Prometeo-Dashboard/blob/master/prometeo-dashboard/src/setupProxy.js

Would this approach help?

Daniel is correct, my initial commit breaks the ability to log in to the site. Adding his suggestion in follow-up commits works locally and when I deploy to our k8s cluster. Seems like this is the right solution for getting past the Invalid Host header problem.