I have tried to setup a LEMP stack environment in Docker for my Laravel application, all the php and routing goes well except my nginx unable to serve any static assets files which locate in public directories and keep returning 404 not fouend error on the fronend. Does anyone know how to resolve this issues?
/etc/nginx/conf.d/default.conf
server {
listen 80;
index index.php index.html;
root /var/www/basic-chat-app/public;
server_name basic-chat-app.test;
charset utf-8;
client_max_body_size 128M;
location / {
try_files $uri $uri/ /index.php?$query_string;
include /etc/nginx/mime.types;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
include fastcgi_params;
include snippets/fastcgi-php.conf
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_index index.php;
}
}
I have tried to setup a LEMP stack environment in Docker for my Laravel application, all the php and routing goes well except my nginx unable to serve any static assets files which locate in public directories and keep returning 404 not fouend error on the fronend. Does anyone know how to resolve this issues?
/etc/nginx/conf.d/default.conf