Q:

METEOR, NGINX subpath error

i have an app deployed with nginx and docker, now i added a second one also with docker so, this will be the case
DOCKER_METEOR_APP1
DOCKER_METEOR_APP2
Both are in the same server SERVER_IP
http://SERVER_IP/DOCKER_METEOR_APP1
http://SERVER_IP/DOCKER_METEOR_APP2
MY NGINX Config is this:
map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}

# HTTP
server {

    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    root /usr/share/nginx/html;
    index index.html index.htm;
    server_name MY_COOL_SERVER;

    location /DOCKER_METEOR_APP1 {
        proxy_pass http://SERVER_IP:8001;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_set_header X-Forwarded-For $remote_addr;
        if ($uri != '/') {
            expires 30d;
        }
    }

    location /DOCKER_METEOR_APP2 {
        proxy_pass http://SERVER_IP:8002;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_set_header X-Forwarded-For $remote_addr;
        if ($uri != '/') {
            expires 30d;
        }
    }

}

THE PROBLEM ?
Each time i try to access one or other app i get the page title and error... it seems that is trying to load content from the root path like
http://SERVER_IP.com/hjas867651877e1u9812931.css?...
What im doing wrong ? is there any solution ?

A:

Okey... my solution to this issue

Added ROOT_URL to each app on 

    ENV ROOT_URL http://127.0.0.1/DOCKER_METEOR_APP1

Also, on lib/startup.js

    Meteor.startup(function() {
      process.env.ROOT_URL = 'http://127.0.0.1/DOCKER_METEOR_APP1/';
    });

And... on my react router got this:

    const history = useBasename( createHistory )(
         { basename: '/DOCKER_METEOR_APP1' }
    )

   <Router history={history}>

