I have a React frontend that uses jwt to authenticate with the Django backend. The backend works and is connecting just fine using django views, but when I try to proxy a r
I'm running into the same problem as well. Most search results mention adding "secure": false
or "ignorePath": true
to your proxy config. Something like this:
"proxy": {
"/api/*": {
"target": "http://localhost:8000",
"secure": false
}
},
May be worth a try but unfortunately none of this worked for me. Although each address (http://localhost:3000 and http://localhost:8000) work completely fine in the browser, maybe since the container is actually proxying it needs to use a Docker address?
EDIT--
Alright I think I figured it out. I believe it did have to do with the container to container communication. Looking in your docker-compose
, your api server is called django
. Change your package.json file to this:
"proxy": {
"/api/*": {
"target": "http://django:8000",
"secure": false
}
}