0

Hi i am new in configuring nginx server and i have a problem:

I have two web applications created with ReactJS which I will call app1 and app2. I'd like to show app1 on www.mydomain.com and app2 on www.mydomain.com/app2 it's possible?

This is my Nginx file configuration /etc/nginx/sites-available/default

server {

    index index.html index.htm index.nginx-debian.html;

    server_name xxx.com www.xxx.com;

location / {
    root  /var/www/app1/build;;
}
location /app2{
     alias  /var/www/app2/build;;
}

Using this configuration file if I connect to www.domain.com App1 works correctly while if I connect to www.domain.com/app2 the page is completely white and the console gives me these errors:

<noscript>You need to enable JavaScript to run this app.</noscript>

2.a90b013e.chunk.js:1 Failed to load resource: the server responded with a status of 404 (Not Found) main.bbc61316.chunk.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)



  • this could help you: https://stackoverflow.com/questions/18198965/serving-multiple-node-apps-with-nginx-on-same-domain – Sidonai Jan 22 '20 at 19:15
  • I found the solution here https://stackoverflow.com/questions/56597159/nginx-serve-multiple-react-applications-on-the-same-server – Davide Michelotti Jan 23 '20 at 22:45

0 Answers0