Error: Invalid JSON RPC response: "" at Object.InvalidResponse (/server/node_modules/web3-core-helpers/src/errors.js:42:16)

I am experiencing a bug while using infura.

On a local test environment(localhost) i am able to send transactions. However, when I moved to the staging environment (on an EC2 instance), whenever I try to send eth or erc20 tokens, I get

Error: Invalid JSON RPC response: “”
at Object.InvalidResponse (/server/node_modules/web3-core-helpers/src/errors.js:42:16)
at XMLHttpRequest.request.onreadystatechange (/server/node_modules/web3-providers-http/src/index.js:92:32)
at XMLHttpRequestEventTarget.dispatchEvent (server/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:22)
at XMLHttpRequest._setReadyState (server/node_modules/xhr2-cookies/dist/xml-http-request.js:208:14)
at XMLHttpRequest._onHttpRequestError (server/node_modules/xhr2-cookies/dist/xml-http-request.js:349:14)
at ClientRequest. (server/node_modules/xhr2-cookies/dist/xml-http-request.js:252:61)
at ClientRequest.emit (events.js:198:13)
at ClientRequest.EventEmitter.emit (domain.js:448:20)
at Socket.socketErrorListener (_http_client.js:392:9)
at Socket.emit (events.js:198:13)
at Socket.EventEmitter.emit (domain.js:448:20)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at process._tickCallback (internal/process/next_tick.js:63:19)

@Keith_Tang, welcome to our community! Can you provide the code you’re using that generates this response?