I am using https on my gallery and when I want to generate multiple size images, the batch manager call i.php via http and this request gets blocked. The blocked request shows in the dev console of a browser (Opera, did not show up in Firefox). As a result the thumbnails generation fails with an error "8 photos can not be regenerated".
I am using https on my gallery and when I want to generate multiple size images, the batch manager call i.php via http and this request gets blocked. The blocked request shows in the dev console of a browser (Opera, did not show up in Firefox). As a result the thumbnails generation fails with an error "8 photos can not be regenerated".
This issue got discovered by flop25 in this topic https://piwigo.org/forum/viewtopic.php?pid=175220#p175220
<!-- github-sync-id:530802677 -->
I can reproduce this exact problem and have figured out a hack to fix it. This occurs for me because I use piwigo with HTTP, but I have it behind a reverse proxy which handles SSL/TLS termination for external traffic.
Because the logic in Piwigo at ws.php?format=json&method=pwg.getMissingDerivatives returns absolute URLs, and because Piwigo thinks it's using HTTP, the protocol is returned to my browser as HTTP but really it's HTTPS.
The fix I did for my instance is to modify gallery/include/functions_url.inc.php
line 48 http should be change to https, because of reverse proxy external protocol being HTTPS.
The long term fix will need to be made in this file, but I'm not a PHP programmer so I can't really contribute more to this.
I can reproduce this exact problem and have figured out a hack to fix it. This occurs for me because I use piwigo with HTTP, but I have it behind a reverse proxy which handles SSL/TLS termination for external traffic.
Because the logic in Piwigo at ws.php?format=json&method=pwg.getMissingDerivatives returns absolute URLs, and because Piwigo thinks it's using HTTP, the protocol is returned to my browser as HTTP but really it's HTTPS.
The fix I did for my instance is to modify gallery/include/functions_url.inc.php
line 48 http should be change to https, because of reverse proxy external protocol being HTTPS.
The long term fix will need to be made in this file, but I'm not a PHP programmer so I can't really contribute more to this.
<!-- github-comment-id:619600549 -->
in case of header X-Forwarded-Host is set, function get_absolute_root_url will not take care of ports.
see https://github.com/Piwigo/Piwigo/blob/86c561156203870b2c07ad9e4a954098c1d69cc2/include/functions_url.inc.php#L50
e.g. for nginx just add to your proxy location:
`proxy_set_header X-Forwarded-Host $http_host;`
see also #681, #982
<!-- github-comment-id:774499529 -->
@hoedlmoser
thank you, this was exactly the solution i needed for piwigo docker container (image from linuxserver.io) with a haproxy reverse proxy in front where ssl terminates, just set the X-Forwarded-Host Header and no more connections over https on port 80
@hoedlmoser
thank you, this was exactly the solution i needed for piwigo docker container (image from linuxserver.io) with a haproxy reverse proxy in front where ssl terminates, just set the X-Forwarded-Host Header and no more connections over https on port 80
i set the following Headers in my Backend
`http-request set-header X-Forwarded-Proto https`
`http-request set-header X-Forwarded-Host photos.example.com`
<!-- github-comment-id:1339349360 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
I am using https on my gallery and when I want to generate multiple size images, the batch manager call i.php via http and this request gets blocked. The blocked request shows in the dev console of a browser (Opera, did not show up in Firefox). As a result the thumbnails generation fails with an error "8 photos can not be regenerated".
This issue got discovered by flop25 in this topic https://piwigo.org/forum/viewtopic.php?pid=175220#p175220
I can reproduce this exact problem and have figured out a hack to fix it. This occurs for me because I use piwigo with HTTP, but I have it behind a reverse proxy which handles SSL/TLS termination for external traffic.
Because the logic in Piwigo at ws.php?format=json&method=pwg.getMissingDerivatives returns absolute URLs, and because Piwigo thinks it's using HTTP, the protocol is returned to my browser as HTTP but really it's HTTPS.
The fix I did for my instance is to modify gallery/include/functions_url.inc.php
line 48 http should be change to https, because of reverse proxy external protocol being HTTPS.
The long term fix will need to be made in this file, but I'm not a PHP programmer so I can't really contribute more to this.
Oh shoot, I didn't see choenig's mention there. Whoops. I'm new to this jithub
in case of header X-Forwarded-Host is set, function get_absolute_root_url will not take care of ports.
see https://github.com/Piwigo/Piwigo/blob/86c561156203870b2c07ad9e4a954098c1d69cc2/include/functions_url.inc.php#L50
e.g. for nginx just add to your proxy location:
proxy_set_header X-Forwarded-Host $http_host;see also #681, #982
@hoedlmoser
thank you, this was exactly the solution i needed for piwigo docker container (image from linuxserver.io) with a haproxy reverse proxy in front where ssl terminates, just set the X-Forwarded-Host Header and no more connections over https on port 80
i set the following Headers in my Backend
http-request set-header X-Forwarded-Proto httpshttp-request set-header X-Forwarded-Host photos.example.comThanks, that did the trick for me too!