/img/logo/ triggers nginx rewrite rule

Hi,
I did a fresh install on ubuntu 22.04.1 following this guide.
But the logo was missing in the invitation mail. I checked the filesystem and img/logo/ is populated with data. But all the images in logo folder are returning 404.

root@vmi435948:~# wget https://■■■■■■.com/img/logo/logo.png
--2022-11-16 22:55:15--  https://■■■■■■.com/img/logo/logo.png
Resolving ■■■■■■.com (■■■■■■.com)... ■■.■■.■■.■■
Connecting to ■■■■■■.com (■■■■■■.com)|■■.■■.■■.■■|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2022-11-16 22:55:15 ERROR 404: Not Found.

Other img folders (avatar, themes, …) work just fine.
I suppose the issue is with nginx conf file. I changed the line with the rewrite.

rewrite ^/([^/]+)/([img|css|js|fonts|locales]+)/(.*)$ /$2/$3 break;

to

rewrite ^/([^/]+)/([css|js|fonts|locales]+)/(.*)$ /$2/$3 break;

and voila, logo folder is back. So the problem has to be that /img/logo/ is triggering the regex. And it indeed is. Every other folder is fine but /img/logo/ triggers the regex and ends up in 404.

3 Likes

Thanks for the report! We’ll dig into it!