pwg.images.getInfo API call can return malformed URLs when running in a Docker container #1871

Open
opened 2026-10-05 00:59:20 +02:00 by adam · 0 comments
Owner

Noticed on 12.2.0 - I'll check whether later versions are similarly affected

I'm running in a set of Docker containers (one for the database, one for php_fpm and one for nginx) and I've noticed that if you map the port on the nginx container to a different published port in docker-compose (e.g. with --ports 9081:8081) the element_URL returned by pwg.images.getInfo contains both ports e.g. https://hostname:9081:8081/photos/....

The workaround is to ensure that nginx is configured to listen on the published port and set --ports so that the two numbers are the same. I'm hoping to make a couple of small enhancements to the APIs I'm working with in the next few weeks so I'll see if I can work out a fix for this at the same time.

Noticed on 12.2.0 - I'll check whether later versions are similarly affected I'm running in a set of Docker containers (one for the database, one for php_fpm and one for nginx) and I've noticed that if you map the port on the nginx container to a different published port in docker-compose (e.g. with --ports 9081:8081) the element_URL returned by pwg.images.getInfo contains both ports e.g. https://hostname:9081:8081/photos/.... The workaround is to ensure that nginx is configured to listen on the published port and set --ports so that the two numbers are the same. I'm hoping to make a couple of small enhancements to the APIs I'm working with in the next few weeks so I'll see if I can work out a fix for this at the same time. <!-- github-sync-id:2254986277 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1871