shish/shimmie2

Enabling Nice URLs break path to thumb/img

Closed this issue · 6 comments

Server Software
about:
title: "meme.museum"
theme: "warm"
url: "https://meme.museum/"

versions:
shimmie: "2.10.7-20240227-a4c1de3+"
schema: 21
php: "8.2.15"
db: "mysql 8.0.36-0ubuntu0.22.04.1"
os: "Linux srv473380 5.15.0-94-generic #104-Ubuntu SMP Tue Jan 9 15:25:40 UTC 2024 x86_64"
server: "nginx/1.21.4"

Client Software (please complete the following information)

  • Device: mobile/desktop
  • Browser: chrome

What steps trigger this bug

  1. Install/update shimmie
  2. Enable Nice URLs in Board Config

What did you expect to happen?
Have images and queries loaded with nice urls, instead of index.php?q=

What actually happened?
Thumbnails and images paths 404

Might be something dumb on my end, as I've no experience with NGINX, but the checkbox said "tested ok" in previous version and "test passed" in current one.

What URLs are being generated for the images? What do you see when visiting that URL? Is there anything in the nginx error log? What does your nginx config look like?

Normal URL: /index.php?q=thumb/#.jpg /index.php?q=image/#.jpg
With Nice URLs: /_thumbs/(hash)/thumb.jpg /_images/(hash)/607%20-%20tagme.jpg
Going to these links return an NGINX 404

Nothing in the error logs (or should I look somewhere other than /var/log/nginx?)

NGINX.conf

include /etc/nginx/sites-enabled/*.conf;

Can you share the site-specific config file? My current guess is that you're using a default-ish nginx config, which somehow works well-enough for the niceurl test to pass (which is surprising for me, I thought that it would require some non-default config to make it work), but doesn't include the shimmie-specific parts (eg https://github.com/shish/shimmie2-examples/blob/main/nginx.conf#L28-L55 )

Would adding those shimmie-specific parts to the end make it work or...?

m.m nginx.conf

Huh, I'm actually not sure how niceurls are working with that config in the first place o_O

But yes the

        location ~ "^/_images/([0-9a-f]{2})([0-9a-f]{30}).*$" {
            alias /var/www/html/data/images/$1/$1$2;
            expires 30d;
        }

        location ~ "^/_thumbs/([0-9a-f]{2})([0-9a-f]{30}).*$" {
            alias /var/www/html/data/thumbs/$1/$1$2;
            expires 30d;
        }

should tell nginx where to load the files from (changing /var/www/... to your own install path)

Thanks a lot!