Running RUM over HTTPS

I'm configuring a new APM server and I already have a Ruby Agent running on my backend. Now I'm trying to setup a frontend monitor and I came across with RUM JS.

All my application runs over HTTPS so becuase of that, I'm forced to setup the RUM agent over HTTPS to avoid mixed content.

That is how i'm initializing it

//= require elastic-apm-rum.umd.min

elasticApm.init({
  serviceName: 'circle_prod',
  serverUrl: 'https://192.168.1.21:8200',
  serviceVersion: '',
  logLevel: 'debug',
})

And for sake of test, I also created locally the following files.

app/assets/javascripts/elastic-apm-rum.umd.js  
app/assets/javascripts/elastic-apm-rum.umd.min.js 
app/assets/javascripts/elastic-apm-rum.umd.min.js.map

But when I load my application I'm getting errors to POST it to Elastic-APM server

DevTools failed to load SourceMap: Could not load content for https://MYURL.com/assets/elastic-apm-rum.umd.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
application_v3-7775e63f66f978e7691e2e07cd29c35e.js:22240 [Elastic APM] Failed sending events! Error: https://192.168.1.21:8200/intake/v2/rum/events HTTP status: 0
    at t.e._constructError (application_v3-7775e63f66f978e7691e2e07cd29c35e.js:22240)
    at application_v3-7775e63f66f978e7691e2e07cd29c35e.js:22240
POST https://192.168.1.21:8200/intake/v2/rum/events net::ERR_ADDRESS_UNREACHABLE

Any idea if I'm skipping any steps?

I also have CORS on my nginx server and I get a 200 response testing it through my app server

curl -H "Origin: http://localhost"   -H "Access-Control-Request-Method: POST"   -H "Access-Control-Request-Headers: X-Requested-With"   -X OPTIONS --verbose http://192.168.1.21:8200/intake/v2/rum/events
*   Trying 192.168.1.21...
* TCP_NODELAY set
* Connected to 192.168.1.21 (192.168.1.21) port 8200 (#0)
> OPTIONS /intake/v2/rum/events HTTP/1.1
> Host: 192.168.1.21:8200
> User-Agent: curl/7.52.1
> Accept: */*
> Origin: http://localhost
> Access-Control-Request-Method: POST
> Access-Control-Request-Headers: X-Requested-With
> 
< HTTP/1.1 200 OK
< Access-Control-Allow-Headers: Content-Type, Content-Encoding, Accept
< Access-Control-Allow-Methods: POST, OPTIONS
< Access-Control-Allow-Origin: http://localhost
< Access-Control-Expose-Headers: Etag
< Access-Control-Max-Age: 3600
< Content-Length: 0
< Vary: Origin
< X-Content-Type-Options: nosniff
< Date: Tue, 23 Mar 2021 03:18:13 GMT
< 

The problem was fixed using a Nginx proxy terminating the SSL and sending it over HTTP using the local network

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.