'Why Are Two (Almost) Identical Angular PWAs Accessing NGINX Server From Different Paths?

I have two Angular PWAs (wrapped in ASPNET) that are basically the same except for icons and stuff. One app has a href base at /app1 and the other is at /app2. I have been getting CORS errors for one of the app when trying to download a file from my back end media folder. I have been having to add cors headers to requests to that folder. When I checked the NGINX access logs, I noticed that the app that gets through without CORS errors has the correct path showing in the access log, but the other one has no path, just a base URL.

App 1:

xxx.xxx.x.x - - [08/Feb/2022:21:15:48 +0000] "GET /media/JSON/filename.json HTTP/1.1" 304 0 "https://www.example.com/app1/" "Mozilla/5.0 (Linux; Android 11; SM-Gxx>

App 2: (notice the path is missing. it should be app2)

xxx.xxx.x.x - - [08/Feb/2022:21:14:44 +0000] "GET /media/JSON/filename.json HTTP/1.1" 304 0 "https://example.com/" "Mozilla/5.0 (Linux; Android 11; SM-Gxxxx) AppleWebKit/>

Can anyone tell me what I'm doing wrong here? I build them both with --base-href /'path'/ and the index html has the correct href for both dist folders. Any ideas how I can fix this? Sure would appreciate it!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source