Azure / pcs-remote-monitoring-webui

Azure IoT PCS Remote Monitoring Web UI
MIT License
54 stars 72 forks source link

Pre-flight request from local to server generating 404 error #1242

Closed smatioli closed 3 years ago

smatioli commented 5 years ago

Type of issue

Description

When running local webui we are having #404 errors. The cause is that GET requests are generating pre-flight requests with method OPTIONS, which are not allowed by the server.

The server is running in --unsafe mode

Steps to reproduce

  1. Deploy remote monitoring solution
  2. Starting microservices in unsafe mode
  3. Running webui locally (with REACT_APP_BASE_SERVICE_URL=https://myapp.azurewebsites.net)

Expected behavior

Requests with method OPTIONS have to be accepted

Current behavior

Some additional information:

-It seems that the PCS_CORS_WHITELIST is not beeing considered correctly. -Running the GET request from postman works fine. -We tried to set CORS in docker-compose.yml file, but it also does not work

Known workarounds

None.

Possible solution

Maybe adjust NGINX config to allow the method.

Context and Environment

Screenshot

image