Dear community,
I'm trying to setup nginx configs this this logic (Nginx multiple locations same server).
core "/" and "api" work, but "/admin" does not open new UI, it's the same "/".Can some one help to fix this small issue. User and Admin UI is different React app.
I did research, asked in stcakoverflow, GPT-3.5 but still it does not work.
https://stackoverflow.com/questions/77369018/nginx-multiple-locations-same-server-doesnt-work
www.domain.com
www.domain.com/admin
www.domain.com/api
server {
listen 80 default_server;
listen [::]:80 default_server;
index index.html index.htm;
server_name _;
# react app & front-end files
location / {
root /opt/client/build;
try_files $uri /index.html;
}
location /admin {
alias /opt/admin/build;
try_files $uri /index.html;
}
# node api reverse proxy
location /api {
proxy_pass http://localhost:5000/;
}
}