Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
ccqnb
Topic Author
Posts: 4
Joined: 28 Oct 2020, 06:55

The preview image couldn't be displayed on x3

28 Oct 2020, 23:02

I built a x3 photo gallery on my vps (server enviroment: nginx 1.16+php 7.2) according to the installation guide, the diagnostic shows everything works fine. But after uploading some images, I couldn't  see the preview of the images, it's just a circle spinning all the time. When I changed nginx with apche, the preview image can be displayed correctly.  I feel that x3 still has some compatibility problems with nginx.

Image
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: The preview image couldn't be displayed on x3

29 Oct 2020, 05:25

The problem is with your nginx rewrite rules. I have already setup and tested X3 successfully on NGINX with these rules:
https://gist.github.com/mjau-mjau/6dc19 ... e566a8457b

More specifically, there is a rule:
Code
rewrite ^/render/. /app/parsers/slir/ last;
The above will rewrite requests for resized images to the X3 image resizer (which is not working in your screenshots above). For example /render/w320/path/image.jpg will rewrite to X3 /app/parsers/slir/?, which then resizes and serves the image. Once the image is created, it will exist in that path, and the rewrite rule will no longer apply.

I have had a couple of users with the same issue, and the problem was that they had conflicting rules in their nginx config. For example some rule that triggers on *.jpg, which then causes the above rule to be ignored. If the rewrite rule is ignored, it means nginx will simply not find the file and report "404 file not found.".
 
User avatar
ccqnb
Topic Author
Posts: 4
Joined: 28 Oct 2020, 06:55

Re: The preview image couldn't be displayed on x3

29 Oct 2020, 09:33

Thanks so much for your answer. I have applied the rules you mentioned on nginx for several times,but the problem remains unsolved.Now I am running the X3 photo-gallery on Apache and it is very nice.