You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Axios Post call retruning 502 proxy error only in production where as request to server is happening and success response from java backend rest api code. axios version is 0.19.0 .
#2937
Closed
sirishasvi opened this issue
Apr 30, 2020
· 3 comments
Can anyone help, as i couldn't recreate this issue to check why this is happening.
I was using axios for calling rest api in my react application, I couldn't find any issue while developing and in uat , but when the code went live , in production always axios one post call is getting 502 proxy error but the same request was made to rest service and in backend everything is success. So , backend is success but user is seeing unsuccess page as it is getting 502 error.
Everything network and load balancers couldn't find any issue.
}
from above code , always the api call is being done and success in rest service, but getting 502 proxy error and going to catch block and showing unsuccess page
This behaviour is only happening in production
Environment:
Axios Version [e.g. 0.19.0]
Browser [e.g. Chrome, Safari]
React 16.9.0
The text was updated successfully, but these errors were encountered:
sirishasvi
changed the title
Axios Post call retruning 502 proxy error only in production where as request is server is happening and success response from java backend rest api code. axios version is 0.19.0 .
Axios Post call retruning 502 proxy error only in production where as request to server is happening and success response from java backend rest api code. axios version is 0.19.0 .
Apr 30, 2020
I am having the same issue. Using a react webview to axios get/post to a client.jar running in the dockerized coder-server instance.
The problem is that the request is being mapped to the local machine's hostname. When I run the client.jar locally from the machine accessing code-server the webview picks up the service running through localhost:XXXX.
Is there a way to force axios to stay relative to the docker-container when using a vscode webview?
I was wrong from starting to check the issue , i got 502 proxy error from client side because of time out issue in my apache sever configuration. increasing it fixed the issue.
@anixon604
In your case , you can try to manage the localhost url using environment variables for all regions .
So based on region, u can pick the particular configuration url.
I was wrong from starting to check the issue , i got 502 proxy error from client side because of time out issue in my apache sever configuration. increasing it fixed the issue.
Can you please tell how to do that ... change timeout in apache?
Can anyone help, as i couldn't recreate this issue to check why this is happening.
I was using axios for calling rest api in my react application, I couldn't find any issue while developing and in uat , but when the code went live , in production always axios one post call is getting 502 proxy error but the same request was made to rest service and in backend everything is success. So , backend is success but user is seeing unsuccess page as it is getting 502 error.
Everything network and load balancers couldn't find any issue.
Example Code
this.postapi().then(function (response) {
//doing something
postapi() {
return axios.post('/postapi', {
}
from above code , always the api call is being done and success in rest service, but getting 502 proxy error and going to catch block and showing unsuccess page
This behaviour is only happening in production
Environment:
The text was updated successfully, but these errors were encountered: