NginxProxyManager / nginx-proxy-manager

Docker container for managing Nginx proxy hosts with a simple, powerful interface
https://nginxproxymanager.com
MIT License
22.15k stars 2.55k forks source link

Unexpected behavior of "Cache Assets" on Hosts with Custom Locations in Docker #2981

Open coanghel opened 1 year ago

coanghel commented 1 year ago

Checklist

Describe the bug

When nesting two react apps such that www.example.com points to react-app-1 and www.example.com/app points to react-app-2, the Nginx Proxy Manager proxy host only works if "cache assets" is disabled.

Nginx Proxy Manager Version

2.10.3

To Reproduce Steps to reproduce the behavior:

  1. Create 2 react apps with the front ends hosted in two separate docker containers
  2. Create a proxy host where www.example.com points to the react-app-1 container
  3. Add a custom location to the same proxy host such that www.example.com/app points to the react-app-2 container
  4. Enable "Cache Assets"
  5. Load www.example.com/app/ and note that only index.html and manifest.json load correctly
  6. Disable "Cache Assets"
  7. Load ww.example.com/app2/ and note that the entire app loads correctly

Expected behavior

I would think that any proxy caching should differentiate based on the location, but I'm not sure what NPM is actually doing when that toggle is on.

Operating System

Running latest docker image. Docker environment is on Ubuntu server jammy.

Additional context

I put a bit more details and screenshots in this SO question.

github-actions[bot] commented 8 months ago

Issue is now considered stale. If you want to keep it open, please comment :+1:

coanghel commented 8 months ago

👍

joshtrichards commented 7 months ago

I would think that any proxy caching should differentiate based on the location, but I'm not sure what NPM is actually doing when that toggle is on.

Not sure the cause of your specific situation, but that button seems to turn this on:

https://github.com/NginxProxyManager/nginx-proxy-manager/blob/develop/docker/rootfs/etc/nginx/conf.d/include/assets.conf