Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hello
I’m trying to make my dockerized React app served by Nginx to connect to backend using the proxy_pass configuration in nginx.conf file and it keep throwing below error.
2021/03/03 23:41:35 [error] 28#28: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.21.0.1, server: 127.0.0.1, request: "POST /authentication/login/ HTTP/1.1", upstream: "http://127.0.0.1:5000/login/", host: "127.0.0.1:8888", referrer: "http://127.0.0.1:8888/login"
Both API backend and containerized React app are running on local. React is running on http://127.0.0.1:8888 and the API is running on http://127.0.0.1:5000.
My nginx.conf file is looking like below
upstream api_server {
server 127.0.0.1:5000;
}
server {
charset UTF-8;
listen 80;
root /usr/share/nginx/html;
index index.html index.htm;
server_name 127.0.0.1;
location /authentication/ {
proxy_pass http://api_server/;
}
location / {
try_files $uri /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
I’ve tried different variations of above, but same results. Can anybody suggest me how to resolve this issue?
santoshpatil
crisdan
KFSys
Andrew J Montanus
nashurgessa
blueviolet
Ibrahim Mudassar
288dccdbfd934607b6f223b33b9d92
TinyLightSeaGreenShrimp
AdorableCeruleanEel
Bobby