Image previews not showing up

Extends https://discord.com/channels/883083792112300104/956270111176679516/1173645569621762128 , please read it. anyways i re-ask it: so i upload an image in a livewire form. in localhost i can see the preview. in prod i cant last update: i tried to publish the livewire config file and modify the temporary_file_upload part, but im still having the same issue u think could be something related to nginx? what should i do?
4 Replies
Bezhan
Bezhan13mo ago
have you given or applied the directory permissions for storage and given access to www-data group for nginx or whatever the nginx group is?
ericmp #2
ericmp #2OP13mo ago
ill have a look hmm
awcodes
awcodes13mo ago
sound's like nginx trying to server your images as static assets directly instead of through livewire's proxy.
ericmp #2
ericmp #2OP13mo ago
🤔 nvm i solved it adding this to the enabled site:
# Pass request to Laravel for any file in a livwire dir.

location ^~ /livewire {
try_files $uri $uri/ /index.php?$query_string;
}


# Cache static files as usual

location ~* \.(?:ico|css|js|gif|jpe?g|png|svg|woff)$ {
expires 10d;
access_log off;
add_header Cache-Control "public";
}
# Pass request to Laravel for any file in a livwire dir.

location ^~ /livewire {
try_files $uri $uri/ /index.php?$query_string;
}


# Cache static files as usual

location ~* \.(?:ico|css|js|gif|jpe?g|png|svg|woff)$ {
expires 10d;
access_log off;
add_header Cache-Control "public";
}
https://github.com/livewire/livewire/issues/1713#issuecomment-703910523
Want results from more Discord servers?
Add your server