Closed vluijkx closed 2 months ago
I have the same issue β all works fine locally but not when deployed live.
I've just copied most of your Nginx config into a Forge server of mine, and I wasn't able to reproduce the issue. π€
@brianshepherd Are you able to share your Nginx config too?
It took a little while but we seem to have figured this one out π. The 400 error was caused by the Glide image signature check and our Nginx proxy setup.
Our proxy sent unescaped URL's to our main server. An URL like https://example.com/%28.jpg
would be transformed to https://example.com/(.jpg
by our proxy. As these paths differ, different Glide signatures would be generated.
We solved this by removing a /
in our proxy Nginx config. Removing the slash causes URL's to be passed correctly.
location / {
- proxy_pass http://{{ upstream_name }}/;
+ proxy_pass http://{{ upstream_name }};
}
Will close this for now. It might be interesting to build some kind of fallback for cases like this by always encoding the request url before generating a signature.
Bug description
Hi! We are currently experiencing an issue similar to https://github.com/statamic/cms/issues/10053. Images containing parentheses in their filenames, respond with Symfony-style 400 errors on our servers. An example can be found on this url:
https://staging.cell-0.com/img/asset/aW1hZ2VzL2JhY2tncm91bmQtKDEuanBn/background-%281.jpg?w=1500&fm=webp&s=283b81e74f43ece5f0175b4c01accde0
Note the
%28
in the filename. Filenames without parentheses like these work fine.We've removed our NGINX rule targeting images because of https://github.com/statamic/cms/issues/10053. This is our current NGINX config:
How to reproduce
We are not sure what server configuration is causing this problem. You could try to run Statamic on a server with an NGINX configuration like ours and upload/view an image with parentheses in the filename. However, I doubt that the NGINX-config is the cause as there is no rule specifically targeting images.
Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response