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)