Похожие чаты

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 ответов

19 просмотров

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)

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

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

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта