I'm building a web app with Docker, Nginx and Lumen. I have completed file upload functionality and everything works fine. However, when I try to access uploaded file from URL Lumen throws me NotFoundHttpException
.
I have already created symlink between storage and public folders using the following command:
ln -s /var/www/storage/app/public /var/www/public/storage
This is my Nginx configuration:
http {
index index.html index.php;
sendfile on;
tcp_nopush on;
gzip on;
gzip_proxied any;
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml;
gzip_vary on;
gzip_disable "msie6";
server {
disable_symlinks off;
listen 80;
listen [::]:80;
server_name api.uhire.test www.api.uhire.test;
root /var/www/public;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
}
My file's path is storage/app/public/customers/1/test.jpeg
. However, this is not accessible if I type http://api.uhire.test/storage/customers/1/test.jpeg
in browser's URL bar.