Docker, apllication dont work properly when try to run it via internet, but it work good on localhost, error calling api

  docker, docker-compose, reverse-proxy

When i try to connect to my application on the server i get error like this

main-es2015.5365d7087b137ac95ade.js:1 BACKEND RETURNED CODE 0 (Unknown Error) | URL: http://localhost:9011/api/v1/importdetailsviews/count " MESSAGE: Http failure response for http://localhost:9011/api/v1/importdetailsviews/count: 0 Unknown Error | BODY: {"isTrusted":true}
(anonymous) @ main-es2015.5365d7087b137ac95ade.js:1
main-es2015.5365d7087b137ac95ade.js:1 ERROR Error: Uncaught (in promise): yc: {"headers":{"normalizedNames":{},"lazyUpdate":null,"headers":{}},"status":0,"statusText":"Unknown Error","url":"http://localhost:9011/api/v1/importdetailsviews/count","ok":false,"name":"HttpErrorResponse","message":"Http failure response for http://localhost:9011/api/v1/importdetailsviews/count: 0 Unknown Error","error":{"isTrusted":true}}
at O (polyfills-es2015.1647d0d4984d18d960f1.js:1)
at O (polyfills-es2015.1647d0d4984d18d960f1.js:1)
at polyfills-es2015.1647d0d4984d18d960f1.js:1
at s.invokeTask (polyfills-es2015.1647d0d4984d18d960f1.js:1)
at Object.onInvokeTask (main-es2015.5365d7087b137ac95ade.js:1)
at s.invokeTask (polyfills-es2015.1647d0d4984d18d960f1.js:1)
at t.runTask (polyfills-es2015.1647d0d4984d18d960f1.js:1)
at g (polyfills-es2015.1647d0d4984d18d960f1.js:1)
at c.invokeTask [as invoke] (polyfills-es2015.1647d0d4984d18d960f1.js:1)
at v (polyfills-es2015.1647d0d4984d18d960f1.js:1)
hn @ main-es2015.5365d7087b137ac95ade.js:1
localhost:9011/api/v1/importdetailsviews/count:1 Failed to load resource: net::ERR_CONNECTION_REFUSED
main-es2015.5365d7087b137ac95ade.js:1 BACKEND RETURNED CODE 0 (Unknown Error) | URL: http://localhost:9011/api/v1/importdetailsviews?PageNumber=1&PageSize=25 " MESSAGE: Http failure response for http://localhost:9011/api/v1/importdetailsviews?PageNumber=1&PageSize=25: 0 Unknown Error | BODY: {"isTrusted":true}
(anonymous) @ main-es2015.5365d7087b137ac95ade.js:1
localhost:9011/api/v1/importdetailsviews?PageNumber=1&PageSize=25:1

It work good on localhost, but i can’t force it to start js when i connect to 192.168.255.18 where stay linux server

Whether use reverse proxy can work here?
Im new in docker so maybe is simpliest way

Source: Docker Questions

LEAVE A COMMENT