Apr 29, 2023
0
Level 3
How can I set separate image folder with nginx from laravel ?
How can I set separate image folder with nginx from laravel ?
I don't want to use laravel for image service.
Instead I want to use nginx for image service.
How can I set nginx for image service with laravel ?
for example ,
I would like to access https://mydomain.com/images/today/1234.png.
My conf is below.
// nginx-mysite.conf
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location /images/ {
root /var/html/ ;
index index.html ;
}
But the https://mydomain.com/images/today/1234.png get 404 error.
How can I fix it ?
Is it bad idea to use nginx for image service ?
Please or to participate in this conversation.