How to point angular front end style folder in Nginx config file

I have two different angular applications, both serving on two different servers, and a proxy server to handle the request from both servers. But both angular build serves their style from a folder known as "assets", this folder is located in server_1 and server_2 of the respective applications. The problem is both applications are looking for the style folder from a common location, which means they looking for the assets folder from server_1.

How do I point the assets folder for each application separately?

server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
proxy_pass http://IP_1/;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
add_header Cache-Control "no-cache";
}
location /kuphubadmin/ {
proxy_pass http://IP_2/;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
add_header Cache-Control "no-cache";
}
}

Note:

  1. Location of application_1 assets(style) folder in server_1 : /var/www/html/application_1/assets
  2. Location of application_2 assets(style) folder in server_2 : /var/www/html/application_2/assets

No answers yet