Похожие чаты

Hi guys! I have an NGINX installed on my CentOS and

I have a laravel app running with php-fpm on docker. I use fastcgi_proxy to pass requests to the fpm container. When I build some frontend, my static files(css, js, photos) that are saved under the public directory, are not loading. Laravel returns 404(it's not nginx's 404) what's the solution?

p.s: my laravel app is mounted using a volume. All of the access rights are the same and the APIs are working correctly. Just asset files are failing.

Thanks in advance

9 ответов

18 просмотров

How are you trying to access the static files

If it’s in public folder as a static asset you can call it directly of course. You need a directive for static files in nginx There’s many articles for that. Check this one for Wordpress https://wordpress.org/support/article/nginx/

Peyman EhsanDoost
still the same...

I would remove laravel completely and see if it serves static assets like jpg or txt

Peyman-EhsanDoost Автор вопроса
Lalo
I would remove laravel completely and see if it se...

Laravel is behind a "fastcgi_proxy" and it's inside a fpm docker container. Nginx is on the OS itself. It's laravel giving the 404 not Nginx.

Peyman EhsanDoost
Laravel is behind a "fastcgi_proxy" and it's insid...

Static assets are not supposed to be served by laravel Instead, nginx serving them directly from public folder

Peyman EhsanDoost
Laravel is behind a "fastcgi_proxy" and it's insid...

Think about it. All laravel knows is what’s in its routes Public assets don’t exist for laravel When you run locally, your php server does serve static assets In production, it’s nginx job to serve static assets

Peyman-EhsanDoost Автор вопроса
Lalo
Think about it. All laravel knows is what’s in it...

Ok so I'll have to write some location block to resolve the assets from the mounted volume?

Peyman EhsanDoost
Ok so I'll have to write some location block to re...

Yeah I guess this is a question for docker expert I guess (I’m not)

Похожие вопросы

Обсуждают сегодня

Ready for some fun AND a chance to win TKO Tokens? Join us for exciting minigames in our Telegram group! 🕒 Don’t miss out—games start on today 25 October 2024, at 8 PM! Ge...
Milkyway | Tokocrypto
255
Мужики и девушки, привет) в Вelphi xe7 в настройках во вкладке "Editor Options" далее " Color" есть список: "Elements", открыв который мы можем настраивать отображение разных...
Kraszx
14
VIP-392 [zkSync] New native USDC market in the Core pool Summary If passed, following the Community proposal “Support native USDC on Venus Core Pool of ZKSync Era” and the a...
Venus Announcements
1
is that okay?
Samurai 🇯🇵
21
Добрый вечер. Есть вопрос, а может и предложение. Был у меня диалог в другой группе о делфи и я задался вопросом: "А нельзя ли в делфи цвет //коментария и {комментария} сде...
Kraszx
24
How about the project bro Likes the community not that active ?
🅿️abby_FX
19
Я вот подумал. SSE выполняет операции максимум с 64-битной точностью. А FPU - всегда с 80-битной. Разве не должно быть FPU точнее тогда?
The Bird of Hermes
13
Guys, Donald Trump or Kamala Harris? It does not matter for Bitcoin in the long run!! 2020 Election: After Joe Biden's victory in November 2020, Bitcoin steadily rose from...
Sabah Shabu
3
как быть с принтером? такой подход прокатит?
zamtmn
12
Мдя, прикол, боевая сборка запускается (именно под отладчиком) после F9 примерно полторы минуты (97 секунд если быть точным). Начал копать - проблема детектится сразу - зависа...
Александр (Rouse_) Багель
38
Карта сайта