HelenaGwyn I think you'll need to combine both, ie you'll need to run a separate instance of calibreweb for each library and then wire them all up to a private Nginx instance.
For each additional instance of calibreweb you'll need to create a new "Nginx Proxy Port" app and then start a new instance of the existing cps
script listening on the new port assignment and pointing at a new database, eg:
# replace NNNNN with your port assignment
export CALIBRE_PORT=NNNNN
# replace XXXXX with the library name
( nohup ~/apps/name_of_app/env/bin/cps -i 127.0.0.1 -p $HOME/.calibre-web/XXXXX-app.db -g $HOME/.calibre-web/XXXXX-gdrive.db >> ~/logs/apps/name_of_app/name_of_app.log 2>&1 & )
Then in your Nginx instance config, each Calibreweb instance will get a location block like so:
# replace XXXXX and NNNNN with your library name and port assignment as above.
location /XXXXX {
proxy_pass http://127.0.0.1:NNNNN;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Script-Name /XXXXX;
}