Reputation: 337
I have a front-end react app, that runs at localhost:3000
. And a back-end that runs at localhost:9900
.
I can access my back-end with a postman's(or curl) localhost:80/api
request.
But I can't access either the site or the server via the web address: my-1stconnection.lan.test
.
What's the problem?
NGINX config:
server {
listen 80;
listen [::]:80;
server_name my-1stconnection.lan.test;
location / {
proxy_pass http://localhost:3000/;
}
location /api {
proxy_pass http://localhost:9900/;
}
}
Upvotes: 2
Views: 13637
Reputation: 337
I forgot one important thing in order to activate the local server:
127.0.0.1 my-1stconnection.lan.test
into /etc/hosts
After this fix, everything started working.
Upvotes: 3