Open sattyframework opened 2 weeks ago
I have found a similar post https://github.com/statamic/cms/issues/10053 which suggest amending nginx config, however I do not have any configuration regarding images.
This looks like a web server error page, rather than a Laravel/Statamic one.
What does your Nginx config look like?
Thanks for the quick reply! Currently the images are only working when I set secure to false in the asset config. I cant see the token being passed in the images url that are showing as 400.
This is my nginx:
...
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_tokens off;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
index index.html index.htm index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log off;
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
i also have this problem, the 400 is gone when setting secure to false in assets.php. Some deeper debugging makes me think that the problem is the generated Url from GlideUrlBuilder, when line 59 "$path .= Str::ensureLeft(URL::encode($filename), '/');" is removed, everythings works fine.
Bug description
Hey all, any help is appreciated. I had upgraded a site from v4 to v5, I did this by setting up a new site with the upgrade on forge and then switching the domain to the current live site.
All images were working prior to switching. I have ran the following commands to clear caches, regenerate presets and meta etc but still no luck.
I have found that changing secure setting in the config to false allows the images to work but obviously this isn't recommended on production.
this is my config otherwise:
I have found a similar post https://github.com/statamic/cms/issues/10053 which suggest amending nginx config, however I do not have any configuration regarding images.
The only other consideration is I am using spatie responsive image, however images were working prior to changing domains so am sure this isnt the issue.
The images return 400 in the network tab
How to reproduce
Upgrade existing site on forge to V5
Logs
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response