Answer the question
In order to leave comments, you need to log in
How to run react-scripts bundle on nginx server?
It’s not the first day I’ve been trying to launch my front end on the server
, the project structure is the following - project / api (launch node / express 8081) / web (react-scripts) / build
from api, launch backend
nodeserver.jswe get a message that everything is running on 8081
serve -s buildwe get a message that everything is running on 5000
server {
listen 80 default_server;
listen [::]:5000 default_server;
root /home/ubuntu/project/web/build;
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
try_files $uri $uri/ =404;
}
Answer the question
In order to leave comments, you need to log in
try removing/commenting out the lines
# listen 80 default_server;
# server_name_;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question