Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

NGINX not routing calls from react app to backend app

$
0
0
I have an AWS Ubuntu server that hosts a react front end running at 127.0.0.1:4100 and calls a Go app using ports 127.0.0.1:1323.I installed Nginx and setup proxy pass for these two ports in /etc/nginx/sites-available/default config file but I only get the front end getting passed by Nginx. Using chrome inspect to check why the Go app is not serving some of the functionalities from the react app, I get this error

client.js:772 GET http://127.0.0.1:1323/api/ net::ERR_CONNECTION_REFUSED
ERROR Error: Request has been terminated Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.

What am I doing wrong? Below is my default config file

server {

listen 80 default_server;
listen [::]:80 default_server;

server_name _;

location / {

proxy_pass http://127.0.0.1:4100;

}

location /api {

proxy_pass http://127.0.0.1:1323/;

}
}

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>